Allow move as move's origin

issue8253
review269251028
This commit is contained in:
Cédric Krier committed 2019-07-08 17:18:14 +02:00
1 parent 3a88dc74f6
commit 73e16504dc
4 files changed
+13 -3

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Allow move as move's origin
* Open product quantities by warehouse to show moves
Version 5.2.0 - 2019-05-06
+3 -3
View File
@@ -415,10 +415,10 @@ class Move(Workflow, ModelSQL, ModelView):
])
return [(None, '')] + [(m.model, m.name) for m in models]
@staticmethod
def _get_origin():
@classmethod
def _get_origin(cls):
'Return list of Model names for origin Reference'
return ['stock.inventory.line']
return [cls.__name__, 'stock.inventory.line']
@classmethod
def get_origin(cls):
+3
View File
@@ -394,6 +394,7 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
# move will be made:
move.planned_date = None
move.company = incoming_move.company
move.origin = incoming_move
return move
@classmethod
@@ -1123,6 +1124,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
company=move.company,
currency=move.currency,
unit_price=move.unit_price,
origin=move,
state='staging' if move.state == 'staging' else 'draft',
)
@@ -1746,6 +1748,7 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
# move will be made:
move.planned_date = None
move.company = incoming_move.company
move.origin = incoming_move
return move
@classmethod
+6
View File
@@ -108,6 +108,12 @@ Set the shipment state to waiting::
2
>>> len(shipment_out.inventory_moves)
2
>>> sorted(
... [m.origin for m in shipment_out.inventory_moves],
... key=lambda m: m.id) == \
... sorted(
... [m for m in shipment_out.outgoing_moves], key=lambda m: m.id)
True
Make 1 unit of the product available::