From 94e03a2a25a9a7df5f736617fd13666db117b3bd Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Fri, 1 Jun 2012 13:35:03 +0200 Subject: [PATCH] [FIX] mrp: fix cost generation when related mrp.workcenter have no product_id set bzr revid: xal@openerp.com-20120601113503-47k48712j6tvl23j --- addons/mrp/mrp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8a25af01e7b..233ea11a592 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -799,7 +799,7 @@ class mrp_production(osv.osv): 'ref': wc.code, 'product_id': wc.product_id.id, 'unit_amount': wc_line.hour, - 'product_uom_id': wc.product_id.uom_id.id + 'product_uom_id': wc.product_id and wc.product_id.uom_id.id or False } ) if wc.costs_journal_id and wc.costs_general_account_id: value = wc_line.cycle * wc.costs_cycle @@ -815,7 +815,7 @@ class mrp_production(osv.osv): 'ref': wc.code, 'product_id': wc.product_id.id, 'unit_amount': wc_line.cycle, - 'product_uom_id': wc.product_id.uom_id.id + 'product_uom_id': wc.product_id and wc.product_id.uom_id.id or False } ) return amount