[FIX] account: added notification on absence of invoice sequence number
authorvra <vra@tinyerp.com>
Thu, 5 Aug 2010 10:49:43 +0000 (16:19 +0530)
committervra <vra@tinyerp.com>
Thu, 5 Aug 2010 10:49:43 +0000 (16:19 +0530)
lp bug: https://launchpad.net/bugs/604529 fixed

bzr revid: vra@tinyerp.com-20100805104943-027udin1v09ifpt9

addons/account/invoice.py

index c6420ea..ab556f7 100644 (file)
@@ -761,6 +761,9 @@ class account_invoice(osv.osv):
                                                                  'account.invoice.' + invtype,
                                                                  'code=%s',
                                                                  context=tmp_context)
+                if not number:
+                    raise osv.except_osv(_('Warning !'), _('There is no active invoice sequence defined for the journal !'))
+
                 if invtype in ('in_invoice', 'in_refund'):
                     ref = reference
                 else: