From ea842f4554b41c7f8cadf250480ba364c25f7927 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 25 Jun 2012 17:55:40 +0200 Subject: [PATCH] [REF] code review bzr revid: qdp-launchpad@openerp.com-20120625155540-n0e5lm0rhytsk22t --- .../account_analytic_analysis_view.xml | 18 ++++------- addons/analytic/analytic_view.xml | 4 +-- .../analytic_contract_project.py | 4 +-- .../hr_timesheet_invoice.py | 30 ++++++------------- 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index cc1d674ca0a..be7af1d4139 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -26,25 +26,17 @@ - - - - + + + + - - - - - - - diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml index 4fa01a92204..1ff623eff5c 100644 --- a/addons/analytic/analytic_view.xml +++ b/addons/analytic/analytic_view.xml @@ -29,9 +29,9 @@ - diff --git a/addons/analytic_contract_project/analytic_contract_project.py b/addons/analytic_contract_project/analytic_contract_project.py index 9ddc75ecf8d..6221617637e 100644 --- a/addons/analytic_contract_project/analytic_contract_project.py +++ b/addons/analytic_contract_project/analytic_contract_project.py @@ -77,7 +77,7 @@ class task(osv.osv): 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) - self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task has been created."), 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 87539de9a08..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', '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."), @@ -95,39 +95,27 @@ class account_analytic_account(osv.osv): def set_close(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'close'}, context=context) - self.set_close_send_note(cr, uid, ids, 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): self.write(cr, uid, ids, {'state':'cancelled'}, context=context) - self.set_cancel_send_note(cr, uid, ids, 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): self.write(cr, uid, ids, {'state':'open'}, context=context) - self.set_open_send_note(cr, uid, ids, 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): self.write(cr, uid, ids, {'state':'pending'}, context=context) - self.set_pending_send_note(cr, uid, ids, context) + message = _("Contract has been set as pending.") + self.message_append_note(cr, uid, ids, body=message, context=context) return True - - def set_open_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been opened.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_close_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been closed.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_cancel_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been cancelled.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_pending_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been pending.") - return self.message_append_note(cr, uid, ids, body=message, context=context) account_analytic_account()