summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-11-09 07:51:34 +0000
committerNicolas Martinelli <nim@odoo.com>2020-11-09 08:27:53 +0000
commitadc6af4aeba7fb5ef43c30714d73e4b9401dc536 (patch)
tree11f5dd8876582a93a8a38647c2e4fac8c023c7ed
parent6b3b9556fc704bad1f88d3afd381c34bbfeb7225 (diff)
[FIX] mrp: make _bom_find return type consistent
MAke sure the `_bom_find` meothd always return a `mrp.bom` recordset.
-rw-r--r--addons/mrp/models/mrp_bom.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py
index fc01dfb1ade..393d53ba6dc 100644
--- a/addons/mrp/models/mrp_bom.py
+++ b/addons/mrp/models/mrp_bom.py
@@ -173,10 +173,10 @@ class MrpBom(models.Model):
def _bom_find(self, product_tmpl=None, product=None, picking_type=None, company_id=False, bom_type=False):
""" Finds BoM for particular product, picking and company """
if product and product.type == 'service' or product_tmpl and product_tmpl.type == 'service':
- return False
+ return self.env['mrp.bom']
domain = self._bom_find_domain(product_tmpl=product_tmpl, product=product, picking_type=picking_type, company_id=company_id, bom_type=bom_type)
if domain is False:
- return domain
+ return self.env['mrp.bom']
return self.search(domain, order='sequence, product_id', limit=1)
def explode(self, product, quantity, picking_type=False):