diff --git a/purchase_by_sale_history_mrp/tests/test_purchase_by_sale_history.py b/purchase_by_sale_history_mrp/tests/test_purchase_by_sale_history.py index 74e6a810..1a881af5 100644 --- a/purchase_by_sale_history_mrp/tests/test_purchase_by_sale_history.py +++ b/purchase_by_sale_history_mrp/tests/test_purchase_by_sale_history.py @@ -46,6 +46,7 @@ class MTestPurchaseBySaleHistoryMRP(test_purchase_by_sale_history.TestPurchaseBy product11_bom = self.env['mrp.bom'].create({ 'product_tmpl_id': product11.product_tmpl_id.id, + # 'product_id': product11.id, # To test specific product 'product_qty': 1.0, 'product_uom_id': product11.uom_id.id, 'bom_line_ids': [(0, 0, { diff --git a/purchase_by_sale_history_mrp/wizard/purchase_by_sale_history.py b/purchase_by_sale_history_mrp/wizard/purchase_by_sale_history.py index b6f877b5..b7f431eb 100644 --- a/purchase_by_sale_history_mrp/wizard/purchase_by_sale_history.py +++ b/purchase_by_sale_history_mrp/wizard/purchase_by_sale_history.py @@ -50,7 +50,7 @@ class PurchaseBySaleHistory(models.TransientModel): def bom_parent_product_ids_line(line): product_ids = set() if line.bom_id.product_id: - product_ids.add((line.bom_id.product_id, line.product_qty)) + product_ids.add((line.bom_id.product_id.id, line.product_qty)) else: for p in line.bom_id.product_tmpl_id.product_variant_ids: product_ids.add((p.id, line.product_qty))