From e2dd18f1e7304040974a81cfacce96848eb89719 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 26 Nov 2014 12:28:45 +0100 Subject: [PATCH] [FIX] mrp: prevent recursion from phantom boms with no lines if the bom is phantom and has no line, we attempt to find a new bom with the default product uom This is possible that we find the same bom that the current one In such a case, we must not explode, to avoid recursion. --- addons/mrp/mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 45b2bcbc047..67f36579f12 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -334,7 +334,7 @@ class mrp_bom(osv.osv): 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: + if newbom and newbom != bom.id: 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]