summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Tuyls <alt@odoo.com>2019-02-07 14:14:37 +0000
committerAlex Tuyls <alt@odoo.com>2019-02-07 14:14:37 +0000
commitd9f9d32f4e7d2408ee6245238a82b24e1fac864f (patch)
treec8fb3b20a0416130914b1d7b014a996f9a2684a0
parentf5107b10f5658f51c5cc07c6f3b7e7b0f38bf8d3 (diff)
[FIX] sale_mrp: incorrect search of BOM in multicompany
In following configuration: - We have two companies: A and B - We have a shared product X - We set a BOM of type KIT for this product X for company B only (the field company on a BOM is mandatory) - We set no BOM for product X for company A because in company A we sell the product as a regular product When we sell product X in company A, as a normal stockable product, the invoicing behavior is the same as when we would sell KIT products. This is because we don't check the SO company when searching the associated BOM. closes odoo/odoo#30927
-rw-r--r--addons/sale_mrp/models/sale_mrp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_mrp/models/sale_mrp.py b/addons/sale_mrp/models/sale_mrp.py
index 9b33c89f57c..68600642c9b 100644
--- a/addons/sale_mrp/models/sale_mrp.py
+++ b/addons/sale_mrp/models/sale_mrp.py
@@ -14,7 +14,7 @@ class SaleOrderLine(models.Model):
# In the case of a kit, we need to check if all components are shipped. Since the BOM might
# have changed, we don't compute the quantities but verify the move state.
- bom = self.env['mrp.bom']._bom_find(product=self.product_id)
+ bom = self.env['mrp.bom']._bom_find(product=self.product_id,company_id=self.company_id.id)
if bom and bom.type == 'phantom':
moves = self.move_ids.filtered(lambda m: m.picking_id and m.picking_id.state != 'cancel')
bom_delivered = all([move.state == 'done' for move in moves])