From 614cfc21d67a55eafaa770beb848223fdd2102c8 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 23 Sep 2011 17:29:02 +0530 Subject: [PATCH] [FIX] cannot create advance invoice in a SO lp bug: https://launchpad.net/bugs/856402 fixed bzr revid: ara@tinyerp.com-20110923115902-0xy62ca4hb8jhq9b --- addons/sale/wizard/sale_make_invoice_advance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 4b1e451..959ed94 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -65,6 +65,13 @@ class sale_advance_payment_inv(osv.osv_memory): that is defined as 'Automatic Invoice after delivery'.")) val = obj_lines.product_id_change(cr, uid, [], sale_adv_obj.product_id.id, uom = False, partner_id = sale.partner_id.id, fposition_id = sale.fiscal_position.id) + + if not val['value'].get('account_id'): + raise osv.except_osv(_('Error !'), + _('There is no income account defined ' \ + 'for this product: "%s" (id:%d)') % \ + (sale_adv_obj.product_id.name, sale_adv_obj.product_id.id,)) + line_id = obj_lines.create(cr, uid, { 'name': val['value']['name'], 'account_id': val['value']['account_id'], -- 1.7.10.4