[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
This commit is contained in:
Mohammed Shekha 2013-03-15 20:12:26 +05:30
parent 6643ad24a9
commit a4e609c469
1 changed files with 3 additions and 2 deletions

View File

@ -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