From a50550225c0c42e6b4a68ea502f4ffaffd8c8880 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 15 Dec 2011 11:19:47 +0530 Subject: [PATCH] [REF] project_mrp: small refactor in _get_project in procurement.order model bzr revid: hmo@tinyerp.com-20111215054947-zmk473sgeeap9wee --- addons/project_mrp/project_procurement.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/project_mrp/project_procurement.py b/addons/project_mrp/project_procurement.py index 52067502abd..e84ecedbe86 100644 --- a/addons/project_mrp/project_procurement.py +++ b/addons/project_mrp/project_procurement.py @@ -60,10 +60,8 @@ class procurement_order(osv.osv): def _get_project(self, cr, uid, procurement, context=None): project_project = self.pool.get('project.project') - project = None - if procurement.product_id.project_id: - project = procurement.product_id.project_id - elif procurement.sale_line_id: + project = procurement.product_id.project_id + if not project and procurement.sale_line_id: analytic_account = procurement.sale_line_id.order_id.project_id if analytic_account: project_ids = project_project.search(cr, uid, [('analytic_account_id', '=', account_id)])