From e25cb298e097ee0449accc94d0f3b3956d8d59f6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 13 Oct 2009 20:15:38 +0530 Subject: [PATCH] [FIX] Sale : Better error message when account is missing from SOL for Invioce lp bug: https://launchpad.net/bugs/449583 fixed bzr revid: jvo@tinyerp.com-20091013144538-2k7w8zug6xvf3nsd --- addons/sale/sale.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 30c24f7af25..6a9572b547c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -818,6 +818,9 @@ class sale_order_line(osv.osv): int(config['price_accuracy'])) fpos = line.order_id.fiscal_position or False a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a) + if not a: + raise osv.except_osv(_('Error !'), + _('There is no income category account defined in default Properties for Product Category or Fiscal Position is not defined !')) inv_id = self.pool.get('account.invoice.line').create(cr, uid, { 'name': line.name, 'origin': line.order_id.name,