From 86c6ecb5b21393f79cfdd006b9ce40e4be9b69e3 Mon Sep 17 00:00:00 2001 From: vra Date: Thu, 5 Aug 2010 16:24:03 +0530 Subject: [PATCH] [FIX] account: added notification on absence of invoice sequence number bzr revid: vra@tinyerp.com-20100805105403-j7ipqdt6zjfao1k7 --- addons/account/invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 1816f4c31bf..d40d4037c97 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -942,6 +942,9 @@ class account_invoice(osv.osv): number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id}) else: number = self.pool.get('ir.sequence').get(cr, uid, 'account.invoice.' + invtype) + + 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