From e5d4b5866af6c272f4782a485497a489d41acbe1 Mon Sep 17 00:00:00 2001 From: ced <> Date: Mon, 19 Feb 2007 09:53:11 +0000 Subject: [PATCH] ACCOUNT: pay only invoice if not in state draft bzr revid: ced-83cb9e7954faa424d5b5d48669159c7a1b6da20d --- addons/account/wizard/wizard_pay_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/wizard_pay_invoice.py b/addons/account/wizard/wizard_pay_invoice.py index 807a6eb79e8..da578d235ca 100644 --- a/addons/account/wizard/wizard_pay_invoice.py +++ b/addons/account/wizard/wizard_pay_invoice.py @@ -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):