From 9491a24744c67cd70c7ab04eb1f676dbd85642c0 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Tue, 11 Oct 2011 15:13:30 +0530 Subject: [PATCH] [IMP] account : used super method inv_line_create in account_anglo_saxon/purchase.py when the product is of service type bzr revid: bde@tinyerp.com-20111011094330-ih1h5bgvp1483hza --- addons/account_anglo_saxon/purchase.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/account_anglo_saxon/purchase.py b/addons/account_anglo_saxon/purchase.py index b4cb7552351..bd44dc188fb 100644 --- a/addons/account_anglo_saxon/purchase.py +++ b/addons/account_anglo_saxon/purchase.py @@ -28,11 +28,8 @@ class purchase_order(osv.osv): def inv_line_create(self, cr, uid, a, ol): line = super(purchase_order, self).inv_line_create(cr, uid, a, ol) - if ol.product_id: - if ol.product_id.type == 'service': - oa = ol.product_id.categ_id.property_account_expense_categ and ol.product_id.categ_id.property_account_expense_categ.id - else: - oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id + if ol.product_id and not ol.product_id.type == 'service': + oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id if not oa: oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id if oa: