diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 76dccebd1d3..7658ab111d9 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -19,6 +19,7 @@ + @@ -71,6 +72,7 @@ + @@ -170,6 +172,7 @@ + diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index c4ae080434f..0ac783a8c5c 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -494,7 +494,6 @@ class account_analytic_account(osv.osv): res['value']['pricelist_id'] = template.pricelist_id.id res['value']['description'] = template.description return res - account_analytic_account() class account_analytic_account_summary_user(osv.osv): diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index a607643f1ec..be7af1d4139 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -23,11 +23,10 @@ - + - / Remaining: - + / Remaining: diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index cb5ab3ede0f..35acc4a8508 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -272,7 +272,20 @@ class account_analytic_account(osv.osv): else: account = self.search(cr, uid, args, limit=limit, context=context) return self.name_get(cr, uid, account, context=context) - + + def create(self, cr, uid, vals, context=None): + contract = super(account_analytic_account, self).create(cr, uid, vals, context=context) + if contract: + self.create_send_note(cr, uid, [contract], context=context) + return contract + # ------------------------------------------------ + # OpenChatter methods and notifications + # ------------------------------------------------ + def create_send_note(self, cr, uid, ids, context=None): + for obj in self.browse(cr, uid, ids, context=context): + self.message_subscribe(cr, uid, [obj.id], [obj.user_id.id], context=context) + self.message_append_note(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), context=context) + account_analytic_account() diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml index d094b6059c0..1ff623eff5c 100644 --- a/addons/analytic/analytic_view.xml +++ b/addons/analytic/analytic_view.xml @@ -9,7 +9,7 @@ - + @@ -29,8 +29,10 @@ - - + + + - + diff --git a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py index 6baa857c0f6..8f24f12808b 100644 --- a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py +++ b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py @@ -123,7 +123,7 @@ class account_analytic_account(osv.osv): if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['charge_expenses'] = template.charge_expenses - res['value']['expense_max'] = template.expense_max + res['value']['est_expenses'] = template.est_expenses return res def open_hr_expense(self, cr, uid, ids, context=None): diff --git a/addons/analytic_contract_project/__openerp__.py b/addons/analytic_contract_project/__openerp__.py index 778d7d4e821..ccf712dc987 100644 --- a/addons/analytic_contract_project/__openerp__.py +++ b/addons/analytic_contract_project/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { - "name" : "Contract Management In Project", + "name" : "Contract On Project", "version": "1.1", "author" : "OpenERP SA", "website" : "http://www.openerp.com", diff --git a/addons/analytic_contract_project/analytic_contract_project.py b/addons/analytic_contract_project/analytic_contract_project.py index 12e307c5a81..6221617637e 100644 --- a/addons/analytic_contract_project/analytic_contract_project.py +++ b/addons/analytic_contract_project/analytic_contract_project.py @@ -70,5 +70,14 @@ class project_project(osv.osv): 'context': view_context, 'nodestroy': True, } - project_project() + +class task(osv.osv): + _inherit = "project.task" + + def create(self, cr, uid, vals, context=None): + task_id = super(task, self).create(cr, uid, vals, context=context) + task_browse = self.browse(cr, uid, task_id, context=context) + self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task %s has been created.") % (task_browse.name), context=context) + return task_id +task() diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 48282a83bb4..81b6325f4fa 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -69,7 +69,7 @@ class account_analytic_account(osv.osv): help="Keep empty if this contract is not limited to a total fixed price."), 'amount_invoiced': fields.function(_invoiced_calc, string='Invoiced Amount', help="Total invoiced"), - 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Timesheet Invocing Ratio', + 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Timesheet Invoicing Ratio', help="Fill this field if you plan to automatically generate invoices based " \ "on the costs in this analytic account: timesheets, expenses, ..." \ "You can configure an automatic invoice rate on analytic accounts."), @@ -94,16 +94,28 @@ class account_analytic_account(osv.osv): return res def set_close(self, cr, uid, ids, context=None): - return self.write(cr, uid, ids, {'state':'close'}, context=context) + self.write(cr, uid, ids, {'state':'close'}, context=context) + message = _("Contract has been closed.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_cancel(self, cr, uid, ids, context=None): - return self.write(cr, uid, ids, {'state':'cancelled'}, context=context) + self.write(cr, uid, ids, {'state':'cancelled'}, context=context) + message = _("Contract has been cancelled.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_open(self, cr, uid, ids, context=None): - return self.write(cr, uid, ids, {'state':'open'}, context=context) + self.write(cr, uid, ids, {'state':'open'}, context=context) + message = _("Contract has been opened.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True def set_pending(self, cr, uid, ids, context=None): - return self.write(cr, uid, ids, {'state':'pending'}, context=context) + self.write(cr, uid, ids, {'state':'pending'}, context=context) + message = _("Contract has been set as pending.") + self.message_append_note(cr, uid, ids, body=message, context=context) + return True account_analytic_account() diff --git a/addons/project/project.py b/addons/project/project.py index a6626aae5d1..ab02cc870bb 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1219,7 +1219,7 @@ class account_analytic_account(osv.osv): _inherit = 'account.analytic.account' _description = 'Analytic Account' _columns = { - 'use_tasks': fields.boolean('Tasks Management'), + 'use_tasks': fields.boolean('Tasks Management',help="If check,this contract will be available in the project menu and you will be able to manage tasks or track issues"), 'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'), }