details: https://code.tryton.org/tryton/commit/0a3674b29c3c
branch: default
user: Cédric Krier <[email protected]>
date: Mon Feb 09 21:46:16 2026 +0100
description:
Set BoM when testing production split
diffstat:
modules/production_split/tests/scenario_production_split.rst | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diffs (32 lines):
diff -r 0af71ac1106b -r 0a3674b29c3c
modules/production_split/tests/scenario_production_split.rst
--- a/modules/production_split/tests/scenario_production_split.rst Mon Feb
09 20:38:45 2026 +0100
+++ b/modules/production_split/tests/scenario_production_split.rst Mon Feb
09 21:46:16 2026 +0100
@@ -14,6 +14,7 @@
>>> 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 @@
>>> 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()