ACCOUNT: pay only invoice if not in state draft

bzr revid: ced-83cb9e7954faa424d5b5d48669159c7a1b6da20d
This commit is contained in:
ced 2007-02-19 09:53:11 +00:00
parent 25f334ffc6
commit e5d4b5866a
1 changed files with 2 additions and 0 deletions

View File

@ -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):