bug fix on credit note of invoice : invoice should not be refund at draft/proforma/cancel states

bzr revid: mra@tinyerp.com-20090305094713-6b9s0kqxnyomq42s
This commit is contained in:
mra (Open ERP) 2009-03-05 15:17:13 +05:30
parent 445cb82263
commit 52f990fde6
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@ class wiz_refund(wizard.interface):
period = False
description = False
for inv in pool.get('account.invoice').browse(cr, uid, data['ids']):
if inv.state == 'draft':
raise wizard.except_wizard(_('Error !'), _('Can not %s draft invoice.') % (mode))
if inv.state in ['draft', 'proforma2', 'cancel']:
raise wizard.except_wizard(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
if form['period'] :
period = form['period']
else: