Fix typo in intrastat_declaration when cancelling moves

Closes #14331
This commit is contained in:
Sergi Almacellas Abellana
2025-11-02 14:33:49 +01:00
parent 8b89c1882b
commit 3eed891976
3 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ class Move(metaclass=PoolMeta):
'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))
@@ -375,3 +375,13 @@ Export declaration as fallback::
... 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'
@@ -386,3 +386,13 @@ Export declaration as fallback::
... 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'