[FIX] cannot create advance invoice in a SO

lp bug: https://launchpad.net/bugs/856402 fixed

bzr revid: ara@tinyerp.com-20110923115902-0xy62ca4hb8jhq9b
This commit is contained in:
ARA (OpenERP) 2011-09-23 17:29:02 +05:30
parent 2c2367e551
commit 614cfc21d6
1 changed files with 7 additions and 0 deletions

View File

@ -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'],