[FIX] account_edi_ubl_cii: remove deprecated peppol eas

As of April 1, 2024, the migration period set by the Peppol Authority of Finland for the requirement
specified in the Peppol Authority Specific Requirements document has ended. According to this requirement,
Finnish end users’ Peppol addresses (participant identifiers) must adhere to the ISO 6523 code list 0216 OVT-format.
Other address types are not allowed for Finnish end users.

See also:
[Finland Peppol Authority requirements](https://peppol.org/wp-content/uploads/2023/08/Finland-Peppol-Authority-Specific-Requirements.pdf)
[Finland Peppol Authority website](https://www.valtiokonttori.fi/en/service/the-state-treasury-is-the-finnish-peppol-authority/#for-service-providers_authority-specific-requirements-in-finland)

It turned out that we have a few others that are no longer used on Peppol.
We will remove those in master as well.
See:
[Peppol codelists](https://docs.peppol.eu/edelivery/codelists/)

no task, reported by the Finnish Peppol Authoirty Team

closes odoo/odoo#162246

X-original-commit: e4519cd0d73029cc482cc4c34e4a57b1432b4c79
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
This commit is contained in:
aliya
2024-04-18 00:32:44 +00:00
parent 23f1edd299
commit c318734d45
4 changed files with 37 additions and 1 deletions
@@ -727,6 +727,30 @@ msgstr ""
msgid "Odoo"
msgstr ""
#. module: account_edi_ubl_cii
#. odoo-python
#: code:addons/account_edi_ubl_cii/models/res_partner.py:0
#, python-format
msgid ""
"Peppol EAS code 9901 is deprecated. Please use a different Danish EAS code "
"instead."
msgstr ""
#. module: account_edi_ubl_cii
#. odoo-python
#: code:addons/account_edi_ubl_cii/models/res_partner.py:0
#, python-format
msgid "Peppol EAS code 9955 is deprecated. Please use 0007 instead."
msgstr ""
#. module: account_edi_ubl_cii
#. odoo-python
#: code:addons/account_edi_ubl_cii/models/res_partner.py:0
#, python-format
msgid ""
"Peppol EAS codes 0212 and 0213 are deprecated. Please use 0216 instead."
msgstr ""
#. module: account_edi_ubl_cii
#: model:ir.model.fields,field_description:account_edi_ubl_cii.field_res_partner__peppol_endpoint
#: model:ir.model.fields,field_description:account_edi_ubl_cii.field_res_users__peppol_endpoint
@@ -54,7 +54,7 @@ EAS_MAPPING = {
'DK': {'0184': 'company_registry', '0198': 'vat'},
'EE': {'9931': 'vat'},
'ES': {'9920': 'vat'},
'FI': {'0213': 'vat'},
'FI': {'0216': None},
'FR': {'0009': 'siret', '9957': 'vat'},
'SG': {'0195': 'l10n_sg_unique_entity_number'},
'GB': {'9932': 'vat'},
@@ -127,6 +127,16 @@ class ResPartner(models.Model):
]
)
@api.constrains('peppol_eas')
def _check_peppol_eas(self):
for partner in self:
if partner.peppol_eas in ('0212', '0213'):
raise ValidationError(_("Peppol EAS codes 0212 and 0213 are deprecated. Please use 0216 instead."))
elif partner.peppol_eas == '9955':
raise ValidationError(_("Peppol EAS code 9955 is deprecated. Please use 0007 instead."))
elif partner.peppol_eas == '9901':
raise ValidationError(_("Peppol EAS code 9901 is deprecated. Please use a different Danish EAS code instead."))
@api.constrains('peppol_endpoint')
def _check_peppol_fields(self):
for partner in self:
@@ -155,6 +155,8 @@ class ResConfigSettings(models.TransientModel):
company = self.company_id
edi_proxy_client = self.env['account_edi_proxy_client.user']
edi_identification = edi_proxy_client._get_proxy_identification(company, 'peppol')
company.partner_id._check_peppol_eas()
if company.partner_id._check_peppol_participant_exists(edi_identification) and not self.account_peppol_migration_key:
raise UserError(
_("A participant with these details has already been registered on the network. "