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

        issue10526
        review338481002
        (grafted from 2311b918f88b7326b95143ac25f9d9f957a47f1f)
diffstat:

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

diffs (31 lines):

diff -r 1821ad6b2054 -r 77bdf8b6d1ce stock.py
--- a/stock.py  Mon May 03 15:47:52 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 1821ad6b2054 -r 77bdf8b6d1ce tests/scenario_product_cost_warehouse.rst
--- a/tests/scenario_product_cost_warehouse.rst Mon May 03 15:47:52 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