[IMP] improved code.

bzr revid: tpa@tinyerp.com-20120510124543-b57sft39eosm6gvb
This commit is contained in:
Turkesh Patel (Open ERP) 2012-05-10 18:15:43 +05:30
parent b7210951a4
commit 257d2fc153
1 changed files with 3 additions and 5 deletions

View File

@ -67,11 +67,9 @@ class sale_advance_payment_inv(osv.osv_memory):
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
value['amount'] = product.list_price
try:
res_id = data_obj._get_id(cr, uid, 'sale', 'advance_product_0')
if res_id:
advance_id = data_obj.browse(cr, uid, res_id, context=context).res_id
if product.id == advance_id:
value['advance'] = 'True'
advance_id = data_obj.get_object_reference(cr, uid, 'sale', 'advance_product_0')[1]
if product.id == advance_id:
value['advance'] = 'True'
finally:
return {'value': value}