changeset 2311b918f88b in modules/product_cost_warehouse:default
details: 
https://hg.tryton.org/modules/product_cost_warehouse?cmd=changeset&node=2311b918f88b
description:
        Allow creating draft move between warehouses

        issue10526
        review338481002
diffstat:

 stock.py                                  |  2 ++
 tests/scenario_product_cost_warehouse.rst |  7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 91f81f524e7c -r 2311b918f88b stock.py
--- a/stock.py  Sun Jul 04 17:54:47 2021 +0200
+++ b/stock.py  Thu Jul 22 19:09:12 2021 +0200
@@ -51,6 +51,8 @@
         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(
diff -r 91f81f524e7c -r 2311b918f88b tests/scenario_product_cost_warehouse.rst
--- a/tests/scenario_product_cost_warehouse.rst Sun Jul 04 17:54:47 2021 +0200
+++ b/tests/scenario_product_cost_warehouse.rst Thu Jul 22 19:09:12 2021 +0200
@@ -139,10 +139,13 @@
     >>> 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'

Reply via email to