diff --git a/modules/account_stock_eu/account_stock_eu.py b/modules/account_stock_eu/account_stock_eu.py index 8eb43f7f08..c1833f717b 100644 --- a/modules/account_stock_eu/account_stock_eu.py +++ b/modules/account_stock_eu/account_stock_eu.py @@ -465,10 +465,11 @@ class IntrastatDeclarationExport_Incoterm(metaclass=PoolMeta): __name__ = 'account.stock.eu.intrastat.declaration.export' def export_fallback_row(self, line): - return super().export_fallback_row(line) + [ - line.transport.code if line.transport else '', - line.incoterm.code if line.incoterm else '', - ] + row = super().export_fallback_row(line) + if self.record.extended: + row.append(line.transport.code if line.transport else '') + row.append(line.incoterm.code if line.incoterm else '') + return row class IntrastatDeclarationExportResult(ModelView): @@ -507,8 +508,6 @@ class IntrastatDeclarationExport_BE(metaclass=PoolMeta): round(line.additional_unit, 2) if line.additional_unit is not None else '', round(line.value, 2), - '', # transport - '', # incoterm line.country_of_origin.code if dispatch and line.country_of_origin else '', line.vat.code if dispatch and line.vat else '', @@ -521,8 +520,8 @@ class IntrastatDeclarationExport_BE_Incoterm(metaclass=PoolMeta): def export_be_row(self, line): row = super().export_be_row(line) if self.record.extended: - row[7] = line.transport.code if line.transport else '' - row[8] = line.incoterm.code if line.incoterm else '' + row.insert(8, line.transport.code if line.transport else '') + row.insert(9, line.incoterm.code if line.incoterm else '') return row diff --git a/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst b/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst index 53e1da4ec6..fce24ba118 100644 --- a/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst +++ b/modules/account_stock_eu/tests/scenario_account_stock_eu_arrival.rst @@ -283,7 +283,7 @@ Export declaration:: >>> _ = declaration.click('export') >>> export = Wizard('account.stock.eu.intrastat.declaration.export', [declaration]) >>> export.form.file - b'19;FR;11;2;9403 10 51;60.0;20.0;1800.00;;;;\r\n19;FR;21;2;9403 10 51;15.0;5.0;750.00;;;;\r\n' + b'19;FR;11;2;9403 10 51;60.0;20.0;1800.00;;\r\n19;FR;21;2;9403 10 51;15.0;5.0;750.00;;\r\n' >>> export.form.filename.endswith('.csv') True >>> declaration.state diff --git a/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst b/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst index 34a84a83a6..eb38f576a6 100644 --- a/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst +++ b/modules/account_stock_eu/tests/scenario_account_stock_eu_dispatch.rst @@ -295,7 +295,7 @@ Export declaration:: >>> export.form.filename.endswith('.csv') True >>> export.form.file - b'29;FR;12;2;9403 10 51;60.0;20.0;1800.00;;;CN;\r\n29;FR;21;2;9403 10 51;15.0;5.0;750.00;;;CN;FR40303265045\r\n' + b'29;FR;12;2;9403 10 51;60.0;20.0;1800.00;CN;\r\n29;FR;21;2;9403 10 51;15.0;5.0;750.00;CN;FR40303265045\r\n' >>> declaration.state 'closed'