[IMP]analytic_contract_project: improve create method in analytic to fix the issue of making a sale order to task of service product

bzr revid: mma@tinyerp.com-20120716091903-rwhx3w7te9rdvrfv
This commit is contained in:
Mayur Maheshwari (OpenERP)
2012-07-16 14:49:03 +05:30
parent 58ffb0e3f8
commit 976593a400
@@ -78,6 +78,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=context)
self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task <em>%s</em> has been <b>created</b>.") % (task_browse.name), context=context)
if task_browse.project_id.analytic_account_id:
self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task <em>%s</em> has been <b>created</b>.") % (task_browse.name), context=context)
return task_id
task()