Allow creating draft move between warehouses
issue10526 review338481002
This commit is contained in:
1 parent
e9e3cca977
commit
737a459d23
2 files changed
+7
-2
No files matched your search
@@ -51,6 +51,8 @@ class Move(metaclass=PoolMeta):
|
||||
config = Configuration(1)
|
||||
transit_locations = {}
|
||||
for move in moves:
|
||||
if move.state in {'staging', 'draft'}:
|
||||
continue
|
||||
company = move.company
|
||||
if company not in transit_locations:
|
||||
transit_location = config.get_multivalue(
|
||||
|
||||
@@ -139,10 +139,13 @@ Forbid direct move between warehouses::
|
||||
>>> move.quantity = 1
|
||||
>>> move.from_location = warehouse1.storage_location
|
||||
>>> move.to_location = warehouse2.storage_location
|
||||
>>> move.save() # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
>>> move.save()
|
||||
>>> move.click('do') # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
MoveValidationError: ...
|
||||
|
||||
>>> move.to_location = transit
|
||||
>>> move.save()
|
||||
>>> move.click('do')
|
||||
>>> move.state
|
||||
'done'
|
||||
Reference in new issue
Block a user