Use internal shipment to create product needs in stock supply test scenario
This commit is contained in:
@@ -15,6 +15,8 @@ Activate modules::
|
||||
>>> config = activate_modules(
|
||||
... ['stock_supply_production', 'production_routing'], create_company)
|
||||
|
||||
>>> Shipment = Model.get('stock.shipment.internal')
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
@@ -51,14 +53,16 @@ Get stock locations::
|
||||
|
||||
Create a need for product::
|
||||
|
||||
>>> Move = Model.get('stock.move')
|
||||
>>> move = Move()
|
||||
>>> shipment = Shipment(from_location=storage_loc, to_location=lost_loc)
|
||||
>>> move = shipment.moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.quantity = 1
|
||||
>>> move.from_location = storage_loc
|
||||
>>> move.to_location = lost_loc
|
||||
>>> move.click('do')
|
||||
>>> move.state
|
||||
>>> shipment.click('wait')
|
||||
>>> shipment.click('assign_force')
|
||||
>>> shipment.click('do')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
|
||||
Create production request::
|
||||
|
||||
@@ -16,6 +16,8 @@ Activate modules::
|
||||
|
||||
>>> config = activate_modules('stock_supply', create_company)
|
||||
|
||||
>>> Shipment = Model.get('stock.shipment.internal')
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
@@ -103,14 +105,16 @@ Execute internal supply::
|
||||
|
||||
Create negative quantity in Second Storage::
|
||||
|
||||
>>> Move = Model.get('stock.move')
|
||||
>>> move = Move()
|
||||
>>> shipment = Shipment(from_location=sec_storage_loc, to_location=lost_loc)
|
||||
>>> move = shipment.moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.quantity = 10
|
||||
>>> move.from_location = sec_storage_loc
|
||||
>>> move.to_location = lost_loc
|
||||
>>> move.click('do')
|
||||
>>> move.state
|
||||
>>> shipment.click('wait')
|
||||
>>> shipment.click('assign_force')
|
||||
>>> shipment.click('do')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
|
||||
Execute internal supply::
|
||||
|
||||
@@ -18,6 +18,7 @@ Activate modules::
|
||||
|
||||
>>> config = activate_modules('stock_supply_production', create_company)
|
||||
|
||||
>>> Shipment = Model.get('stock.shipment.internal')
|
||||
>>> Warning = Model.get('res.user.warning')
|
||||
|
||||
Create product::
|
||||
@@ -51,23 +52,31 @@ Get stock locations::
|
||||
|
||||
Create needs for product::
|
||||
|
||||
>>> Move = Model.get('stock.move')
|
||||
>>> move = Move()
|
||||
>>> shipment = Shipment(from_location=storage_loc, to_location=lost_loc)
|
||||
>>> move = shipment.moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.quantity = 1
|
||||
>>> move.from_location = storage_loc
|
||||
>>> move.to_location = lost_loc
|
||||
>>> move.click('do')
|
||||
>>> move.state
|
||||
>>> shipment.click('wait')
|
||||
>>> shipment.click('assign_force')
|
||||
>>> shipment.click('do')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
|
||||
>>> move, = move.duplicate(
|
||||
... default={'effective_date': today + dt.timedelta(days=10)})
|
||||
>>> shipment, = shipment.duplicate()
|
||||
>>> shipment.effective_date = today + dt.timedelta(days=10)
|
||||
>>> move, = shipment.moves
|
||||
>>> move.effective_date = shipment.effective_date
|
||||
>>> shipment.click('wait')
|
||||
>>> shipment.click('assign_force')
|
||||
>>> try:
|
||||
... move.click('do')
|
||||
... shipment.click('do')
|
||||
... except MoveFutureWarning as warning:
|
||||
... Warning(user=config.user, name=warning.name).save()
|
||||
>>> move.click('do')
|
||||
>>> shipment.click('do')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
|
||||
There is no production request::
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ Activate modules::
|
||||
|
||||
>>> BoM = Model.get('production.bom')
|
||||
>>> Location = Model.get('stock.location')
|
||||
>>> Move = Model.get('stock.move')
|
||||
>>> ProductTemplate = Model.get('product.template')
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
>>> Production = Model.get('production')
|
||||
>>> Shipment = Model.get('stock.shipment.internal')
|
||||
|
||||
Create product with a BoM::
|
||||
|
||||
@@ -55,13 +55,16 @@ Get stock locations::
|
||||
|
||||
Create needs for product::
|
||||
|
||||
>>> move = Move()
|
||||
>>> shipment = Shipment(from_location=storage_loc, to_location=lost_loc)
|
||||
>>> move = shipment.moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.quantity = 2
|
||||
>>> move.from_location = storage_loc
|
||||
>>> move.to_location = lost_loc
|
||||
>>> move.click('do')
|
||||
>>> move.state
|
||||
>>> shipment.click('wait')
|
||||
>>> shipment.click('assign_force')
|
||||
>>> shipment.click('do')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
|
||||
Create production request::
|
||||
|
||||
Reference in New Issue
Block a user