ACCOUNT: pay only invoice if not in state draft
bzr revid: ced-83cb9e7954faa424d5b5d48669159c7a1b6da20d
This commit is contained in:
parent
25f334ffc6
commit
e5d4b5866a
|
@ -86,6 +86,8 @@ def _get_period(self, cr, uid, data, context={}):
|
|||
if len(ids):
|
||||
period_id = ids[0]
|
||||
invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
|
||||
if invoice.state == 'draft':
|
||||
raise wizard.except_wizard('Error !', 'Can not pay draft invoice.')
|
||||
return {'period_id': period_id, 'amount': invoice.amount_total}
|
||||
|
||||
class wizard_pay_invoice(wizard.interface):
|
||||
|
|
Loading…
Reference in New Issue