From a4e609c4696925aa7bb2f06f8e541345520c3015 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Fri, 15 Mar 2013 20:12:26 +0530 Subject: [PATCH] [FIX]Fixed the issue of account receivable property not found if someone has explicitly delete the property added by data file, the code was throwing traceback if there is no property_account_receivable found so even though user deletes data file record code should throw traceback to user, if property_account_receivable not found then we are going to use current_company.account_receivable.id. bzr revid: msh@openerp.com-20130315144226-eqsz74ohwjbxnp3z --- addons/point_of_sale/point_of_sale.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 7d608a73a7b..194c5b5a452 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -921,11 +921,12 @@ class pos_order(osv.osv): user_company = user_proxy.browse(cr, order.user_id.id, order.user_id.id).company_id group_tax = {} - account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context).id + account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) order_account = order.partner_id and \ order.partner_id.property_account_receivable and \ - order.partner_id.property_account_receivable.id or account_def or current_company.account_receivable.id + order.partner_id.property_account_receivable.id or \ + account_def and account_def.id or current_company.account_receivable.id if move_id is None: # Create an entry for the sale