details:   https://code.tryton.org/tryton/commit/b4579117d331
branch:    7.4
user:      Sergi Almacellas Abellana <[email protected]>
date:      Sun Nov 02 14:33:49 2025 +0100
description:
        Fix typo in intrastat_declaration when cancelling moves

        Closes #14331
        (grafted from b3594efd06b3799feeb1d21c64c762f6bd7d5402)
diffstat:

 modules/account_stock_eu/stock.py                                     |   2 +-
 modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst  |  10 
++++++++++
 modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst |  10 
++++++++++
 3 files changed, 21 insertions(+), 1 deletions(-)

diffs (46 lines):

diff -r a61d91cf6120 -r b4579117d331 modules/account_stock_eu/stock.py
--- a/modules/account_stock_eu/stock.py Sun Nov 02 17:37:58 2025 +0100
+++ b/modules/account_stock_eu/stock.py Sun Nov 02 14:33:49 2025 +0100
@@ -242,7 +242,7 @@
             'account.stock.eu.intrastat.declaration')
         super().cancel(moves)
         declarations = {
-            m.declaration for m in moves if m.intrastat_declaration}
+            m.intrastat_declaration for m in moves if m.intrastat_declaration}
         if declarations:
             IntrastatDeclaration.open(
                 IntrastatDeclaration.browse(declarations))
diff -r a61d91cf6120 -r b4579117d331 
modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst
--- a/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst      
Sun Nov 02 17:37:58 2025 +0100
+++ b/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst      
Sun Nov 02 14:33:49 2025 +0100
@@ -375,3 +375,13 @@
     ...     b'arrival,FR,2,9403 10 51,15.0,750.00,21,5.0,,\r\n')
     >>> export.form.filename.endswith('.csv')
     True
+
+Cancelling the shipment reopens the declaration::
+
+    >>> shipment.click('cancel')
+    >>> shipment.state
+    'cancelled'
+
+    >>> declaration.reload()
+    >>> declaration.state
+    'opened'
diff -r a61d91cf6120 -r b4579117d331 
modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst
--- a/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst     
Sun Nov 02 17:37:58 2025 +0100
+++ b/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst     
Sun Nov 02 14:33:49 2025 +0100
@@ -386,3 +386,13 @@
     ...     if intrastat_extended else
     ...     b'dispatch,FR,2,9403 10 51,60.0,1800.00,12,20.0,CN,\r\n'
     ...     b'dispatch,FR,2,9403 10 
51,15.0,750.00,21,5.0,CN,FR40303265045\r\n')
+
+Cancelling the shipment reopens the declaration::
+
+    >>> shipment.click('cancel')
+    >>> shipment.state
+    'cancelled'
+
+    >>> declaration.reload()
+    >>> declaration.state
+    'opened'

Reply via email to