Better error message

bzr revid: ced-fe03323241e5001d6fcf866e0a0fa7a1a9e4f8f3
This commit is contained in:
ced 2007-12-13 13:39:40 +00:00
parent 85f4ece183
commit 7e33235a8d
1 changed files with 3 additions and 1 deletions

View File

@ -671,7 +671,9 @@ class account_move(osv.osv):
toremove = []
for move in self.browse(cr, uid, ids, context):
if move['state'] <> 'draft':
raise osv.except_osv('Error', 'You must first cancel the invoice movement: %s !' % move['name'])
raise osv.except_osv('UserError',
'You can not delete posted movement: "%s"!' % \
move['name'])
line_ids = map(lambda x: x.id, move.line_id)
context['journal_id'] = move.journal_id.id
context['period_id'] = move.period_id.id