[MERGE] OPW 575766: project: fix error message not translated when trying to delete an analytic account linked to a project

bzr revid: xal@openerp.com-20120720151203-5bbj35j32ff9cfpq
This commit is contained in:
Xavier ALT
2012-07-20 17:12:03 +02:00
+3 -3
View File
@@ -1139,12 +1139,12 @@ class account_analytic_account(osv.osv):
vals['child_ids'] = []
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
def unlink(self, cr, uid, ids, *args, **kwargs):
def unlink(self, cr, uid, ids, context=None):
project_obj = self.pool.get('project.project')
analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])
analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)], context=context)
if analytic_ids:
raise osv.except_osv(_('Warning !'), _('Please delete the project linked with this account first.'))
return super(account_analytic_account, self).unlink(cr, uid, ids, *args, **kwargs)
return super(account_analytic_account, self).unlink(cr, uid, ids, context=context)
account_analytic_account()