Set BoM when testing production split

This commit is contained in:
Cédric Krier
2026-02-09 21:46:16 +01:00
parent b3525db241
commit 853870a1c9
@@ -14,6 +14,7 @@ Activate modules::
>>> config = activate_modules('production_split', create_company)
>>> BoM = Model.get('production.bom')
>>> ProductTemplate = Model.get('product.template')
>>> ProductUom = Model.get('product.uom')
>>> Production = Model.get('production')
@@ -31,10 +32,20 @@ Create product::
>>> template.save()
>>> product, = template.products
Create bill of material::
>>> bom = BoM(name="Product")
>>> _ = bom.outputs.new(product=product, quantity=1)
>>> bom.save()
>>> _ = product.boms.new(bom=bom)
>>> product.save()
Create a production::
>>> production = Production()
>>> production.product = product
>>> production.bom = bom
>>> production.quantity = 10
>>> production.save()