fixed bug: if phantom product does not BOM component, it's should be added in production's move lines on computing production order

bzr revid: hmo@tinyerp.com-20090119051239-bplvlcox3ufjtiur
This commit is contained in:
Harry (Open ERP) 2009-01-19 10:42:39 +05:30
parent 54540f9ae8
commit 3a240624d0
1 changed files with 4 additions and 2 deletions

View File

@ -258,15 +258,17 @@ class mrp_bom(osv.osv):
factor = bom.product_rounding
result = []
result2 = []
phantom=False
if bom.type=='phantom' and not bom.bom_lines:
newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties)
if newbom:
res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10)
result = result + res[0]
result2 = result2 + res[1]
phantom=True
else:
return [],[]
else:
phantom=False
if not phantom:
if addthis and not bom.bom_lines:
result.append(
{