Merge pull request #344 from odoo-dev/saas-5-fix-mrp.bom-wrong-bom_find-check-chm

[FIX] mrp.bom: wrong check for bom_find.

If the user defined a bom line type phantom to a product without bom the check is wrong to display the error message.
This commit is contained in:
Christophe Simonis 2014-06-04 19:22:31 +02:00
commit 651e5acd5d
1 changed files with 2 additions and 2 deletions

View File

@ -325,8 +325,8 @@ class mrp_bom(osv.osv):
})
else:
bom_id = self._bom_find(cr, uid, bom_line_id.product_uom.id, product_id=bom_line_id.product_id.id, properties=properties)
bom2 = self.browse(cr, uid, bom_id)
if bom2:
if bom_id:
bom2 = self.browse(cr, uid, bom_id)
res = self._bom_explode(cr, uid, bom2, bom_line_id.product_id, factor,
properties=properties, level=level + 10, previous_products=all_prod, master_bom=master_bom)
result = result + res[0]