[FIX] account_move_line._update_check - please include move_id.name in error message

lp bug: https://launchpad.net/bugs/772476 fixed

bzr revid: ara@tinyerp.com-20110518111624-cwu4622ddx2nlvql
This commit is contained in:
Ferdinand @ Camptocamp 2011-05-18 16:46:24 +05:30 committed by ARA (OpenERP)
parent de0f30f575
commit befc1d3eda
1 changed files with 3 additions and 2 deletions

View File

@ -1198,10 +1198,11 @@ class account_move_line(osv.osv):
def _update_check(self, cr, uid, ids, context=None):
done = {}
for line in self.browse(cr, uid, ids, context=context):
err_msg = _('Move name (id): ') + line.move_id.name +' ('+ str(line.move_id.id) +')'
if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted):
raise osv.except_osv(_('Error !'), _('You can not do this modification on a confirmed entry ! Please note that you can just change some non important fields !'))
raise osv.except_osv(_('Error !'), _('You can not do this modification on a confirmed entry ! Please note that you can just change some non important fields ! \n%s') % err_msg)
if line.reconcile_id:
raise osv.except_osv(_('Error !'), _('You can not do this modification on a reconciled entry ! Please note that you can just change some non important fields !'))
raise osv.except_osv(_('Error !'), _('You can not do this modification on a reconciled entry ! Please note that you can just change some non important fields ! \n%s') % err_msg)
t = (line.journal_id.id, line.period_id.id)
if t not in done:
self._update_journal_check(cr, uid, line.journal_id.id, line.period_id.id, context)