ACCOUNT: improve error message on cancel invoice
bzr revid: ced-3130281f2a5a3e09d5b63ff596401d0e15e549ac
This commit is contained in:
@@ -618,6 +618,8 @@ class account_move(osv.osv):
|
||||
def unlink(self, cr, uid, ids, context={}, check=True):
|
||||
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'])
|
||||
line_ids = map(lambda x: x.id, move.line_id)
|
||||
context['journal_id'] = move.journal_id.id
|
||||
context['period_id'] = move.period_id.id
|
||||
|
||||
Reference in New Issue
Block a user