bug fix on credit note of invoice : invoice should not be refund at draft/proforma...
authormra (Open ERP) <mra@tinyerp.com>
Thu, 5 Mar 2009 09:47:13 +0000 (15:17 +0530)
committermra (Open ERP) <mra@tinyerp.com>
Thu, 5 Mar 2009 09:47:13 +0000 (15:17 +0530)
bzr revid: mra@tinyerp.com-20090305094713-6b9s0kqxnyomq42s

addons/account/wizard/wizard_refund.py

index 85ecb25..90a9ce7 100644 (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: