From d72906e548cae992a721e181e997d94d26669f91 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Wed, 30 Mar 2022 14:27:47 +0200 Subject: [PATCH] [14.0][IMP] intrastat_product: Add codes in Excel report as required in some countries In some countries, the imports are done through Excel imports. They need the codes only in the columns. --- .../models/intrastat_product_declaration.py | 4 +++ .../report/intrastat_product_report_xls.py | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index f807dd8..4e082dc 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -984,13 +984,17 @@ class IntrastatProductDeclaration(models.Model): """ return [ "hs_code", + "product_origin_country_code", "product_origin_country", + "src_dest_country_code", "src_dest_country", "amount_company_currency", + "transaction_code", "transaction", "weight", "suppl_unit_qty", "suppl_unit", + "transport_code", "transport", "vat", ] diff --git a/intrastat_product/report/intrastat_product_report_xls.py b/intrastat_product/report/intrastat_product_report_xls.py index daa63b1..4fdc891 100644 --- a/intrastat_product/report/intrastat_product_report_xls.py +++ b/intrastat_product/report/intrastat_product_report_xls.py @@ -41,6 +41,14 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): }, "width": 36, }, + "product_origin_country_code": { + "header": {"type": "string", "value": self._("Product C/O Code")}, + "line": { + "type": "string", + "value": self._render("line.product_origin_country_id.code or ''"), + }, + "width": 28, + }, "product_origin_country": { "header": {"type": "string", "value": self._("Product C/O")}, "line": { @@ -57,6 +65,17 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): }, "width": 14, }, + "src_dest_country_code": { + "header": { + "type": "string", + "value": self._("Country of Origin/Destination"), + }, + "line": { + "type": "string", + "value": self._render("line.src_dest_country_id.code"), + }, + "width": 28, + }, "src_dest_country": { "header": { "type": "string", @@ -96,6 +115,14 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): }, "width": 18, }, + "transaction_code": { + "header": { + "type": "string", + "value": self._("Intrastat Transaction code"), + }, + "line": {"value": self._render("line.transaction_id.code")}, + "width": 36, + }, "transaction": { "header": {"type": "string", "value": self._("Intrastat Transaction")}, "line": {"value": self._render("line.transaction_id.display_name")}, @@ -139,6 +166,11 @@ class IntrastatProductDeclarationXlsx(models.AbstractModel): "line": {"value": self._render("line.incoterm_id.name or ''")}, "width": 14, }, + "transport_code": { + "header": {"type": "string", "value": self._("Transport Mode Code")}, + "line": {"value": self._render("line.transport_id.code or ''")}, + "width": 14, + }, "transport": { "header": {"type": "string", "value": self._("Transport Mode")}, "line": {"value": self._render("line.transport_id.name or ''")},