diff --git a/intrastat_product/models/account_move.py b/intrastat_product/models/account_move.py index 0fc9bca..6c7e143 100644 --- a/intrastat_product/models/account_move.py +++ b/intrastat_product/models/account_move.py @@ -3,8 +3,7 @@ # @author Alexis de Lattre # @author Luc de Meyer -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from odoo import api, fields, models class AccountMove(models.Model): @@ -180,6 +179,7 @@ class AccountMoveIntrastatLine(models.Model): ) product_origin_country_code = fields.Char( string="Country of Origin of the Product", + size=2, required=True, default="QU", help="2 digit code of country of origin of the product except for the UK.\n" @@ -212,10 +212,3 @@ class AccountMoveIntrastatLine(models.Model): vals["product_origin_country_code"] = ( vals["product_origin_country_code"].upper().strip() ) - if len(vals["product_origin_country_code"]) != 2: - raise UserError( - _( - "Intrastat transaction details error:\n" - "Product Origin Country Code must be 2 characters." - ) - ) diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index 4518967..ca066ec 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -1139,6 +1139,7 @@ class IntrastatProductComputationLine(models.Model): ) product_origin_country_code = fields.Char( string="Country of Origin of the Product", + size=2, required=True, default="QU", help="2 digit code of country of origin of the product except for the UK.\n" @@ -1251,6 +1252,7 @@ class IntrastatProductDeclarationLine(models.Model): ) product_origin_country_code = fields.Char( string="Country of Origin of the Product", + size=2, required=True, default="QU", help="2 digit code of country of origin of the product except for the UK.\n"