From 257d2fc1539c8f282b8a34cf93b5e2f3d4b0a10b Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Thu, 10 May 2012 18:15:43 +0530 Subject: [PATCH] [IMP] improved code. bzr revid: tpa@tinyerp.com-20120510124543-b57sft39eosm6gvb --- addons/sale/wizard/sale_make_invoice_advance.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 9a9eda88c70..f1f7989a54c 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -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}