details: https://code.tryton.org/tryton/commit/b3594efd06b3
branch: default
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
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 18e3230ebd92 -r b3594efd06b3 modules/account_stock_eu/stock.py
--- a/modules/account_stock_eu/stock.py Tue Oct 28 18:50:24 2025 +0100
+++ b/modules/account_stock_eu/stock.py Sun Nov 02 14:33:49 2025 +0100
@@ -231,7 +231,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 18e3230ebd92 -r b3594efd06b3
modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst
--- a/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst
Tue Oct 28 18:50:24 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 18e3230ebd92 -r b3594efd06b3
modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst
--- a/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst
Tue Oct 28 18:50:24 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'