parent
651097e659
commit
c44f29fb33
2
load.py
2
load.py
|
@ -322,6 +322,8 @@ class LoadOrder(metaclass=PoolMeta):
|
|||
Move.assign(outgoing_moves)
|
||||
if self.type == 'out':
|
||||
Move.do(inventory_moves)
|
||||
if shipment.state == 'done':
|
||||
Move.do(outgoing_moves)
|
||||
else:
|
||||
shipment_moves = [m for m in shipment.moves
|
||||
if m.unit_load in _groupitems]
|
||||
|
|
|
@ -433,6 +433,40 @@ Force load another UL::
|
|||
>>> sum(m.quantity for m in order.outgoing_moves)
|
||||
4.0
|
||||
|
||||
Add a third UL with done shipment::
|
||||
|
||||
>>> order.lines[0].ul_quantity += 1
|
||||
>>> order.save()
|
||||
>>> ul = create_unit_load(config=config, do_state=False,
|
||||
... default_values={'start_date': datetime.datetime.now() + relativedelta(days=-1)})
|
||||
>>> ul.product = main_product
|
||||
>>> ul.save()
|
||||
>>> move = ul.moves.new()
|
||||
>>> move.planned_date = today
|
||||
>>> move.product = product
|
||||
>>> move.quantity = Decimal(2)
|
||||
>>> move.from_location = ul.moves[0].from_location
|
||||
>>> move.to_location = ul.moves[0].to_location
|
||||
>>> move.currency = move.company.currency
|
||||
>>> ul.save()
|
||||
>>> ul.click('assign')
|
||||
>>> ul.click('do')
|
||||
>>> Model.get('res.user.warning')(user=config.user,
|
||||
... name='loading_ul_origin_4', always=True).save()
|
||||
>>> start_load = Wizard('carrier.load_uls', [order])
|
||||
>>> shipment.click('done')
|
||||
>>> shipment.state
|
||||
'done'
|
||||
>>> start_load.form.ul_code = ul.code
|
||||
>>> start_load.execute('load_')
|
||||
>>> shipment.reload()
|
||||
>>> len(shipment.unit_loads)
|
||||
3
|
||||
>>> list(set(m.state for m in shipment.outgoing_moves))
|
||||
['done']
|
||||
>>> list(set(m.state for m in shipment.inventory_moves))
|
||||
['done']
|
||||
|
||||
Confirm load::
|
||||
|
||||
>>> load.click('confirm')
|
||||
|
|
Loading…
Reference in New Issue