Set BoM when testing production split
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user