From 2570eeb97dca24c48eb869692e1ff2cfe6c1d3c0 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 19 Oct 2011 14:57:16 +0530 Subject: [PATCH] [FIX] account : multi-company invoice validation error lp bug: https://launchpad.net/bugs/810548 fixed bzr revid: mdi@tinyerp.com-20111019092716-03vvdbbih9lr4oqf --- addons/account/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 8f873065014..e28e22f1005 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -927,6 +927,8 @@ class account_invoice(osv.osv): period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d')), ('company_id', '=', inv.company_id.id)]) if period_ids: period_id = period_ids[0] + else: + raise osv.except_osv(_('No Period Defined !'),_("You must first define a period !") ) if period_id: move['period_id'] = period_id for i in line: