From 0988223c46df55497ea370f4e0aaeb3dd5ec5fa1 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 26 Dec 2021 13:51:33 +0100 Subject: [PATCH] [14.0]Intrastat Brexit support --- product_harmonized_system/models/product_template.py | 12 +++++++++++- product_harmonized_system/views/product_template.xml | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index 4670cfc..d524206 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -23,10 +23,20 @@ class ProductTemplate(models.Model): "and configure the H.S. code on the product category.", ) origin_country_id = fields.Many2one( - "res.country", + comodel_name="res.country", string="Country of Origin", help="Country of origin of the product i.e. product " "'made in ____'.", ) + origin_state_id = fields.Many2one( + comodel_name="res.country.state", + string="Country State of Origin", + domain="[('country_id', '=?', origin_country_id)]", + help="Country State of origin of the product.\n" + "This field is used for the Intrastat declaration, " + "selecting 'Northern Ireland' will set the code 'XI' " + "for products from the United Kingdom whereas code 'XU' " + "will be used for the other UK states.", + ) class ProductProduct(models.Model): diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index 59fa83e..79d2b27 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -20,6 +20,10 @@ name="origin_country_id" attrs="{'invisible': [('type', '=', 'service')]}" /> +