Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] [MIG] partner_identification_eori #1803

Open
wants to merge 7 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed pandoc-3.1.12.1-1-amd64.deb
Binary file not shown.
Binary file removed pandoc-3.1.12.3-1-amd64.deb
Binary file not shown.
Binary file removed pandoc-3.1.9-1-amd64.deb
Binary file not shown.
83 changes: 83 additions & 0 deletions partner_identification_eori/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
===========================
Partner Identification EORI
===========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e174da0d3d72f1f932a0784283afce872f8c6646c3f65bc79b4a6f770a438cfe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/17.0/partner_identification_eori
:alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_identification_eori
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This addon extends "Partner Identification Numbers" to provide a number
category for EORI Number.

see:
https://taxation-customs.ec.europa.eu/customs-4/customs-procedures-import-and-export-0/customs-procedures/economic-operators-registration-and-identification-number-eori_en

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_identification_eori%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- Jordi Masvidal <jordi.masvidal@forgeflow.com>
- `Binhex <https://binhex.cloud/>`__:

- Deriman Alonso

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/17.0/partner_identification_eori>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions partner_identification_eori/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions partner_identification_eori/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Identification EORI",
"summary": """
This addon extends "Partner Identification Numbers"
to provide a number category for EORI Number""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"depends": ["partner_identification"],
"data": ["data/partner_identification_eori.xml"],
"installable": True,
}
15 changes: 15 additions & 0 deletions partner_identification_eori/data/partner_identification_eori.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record
id="partner_identification_eori_number_category"
model="res.partner.id_category"
>
<field name="name">EORI Identification Number</field>
<field name="code">eori_id_number</field>
<field
name="validation_code"
><![CDATA[failed = self.validate_res_partner_eori(id_number)]]></field>
</record>
</odoo>
27 changes: 27 additions & 0 deletions partner_identification_eori/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_identification_eori
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-27 09:37+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: partner_identification_eori
#: model:res.partner.id_category,name:partner_identification_eori.partner_identification_eori_number_category
msgid "EORI Identification Number"
msgstr "Numeri di identificazione EORI"

#. module: partner_identification_eori
#: model:ir.model,name:partner_identification_eori.model_res_partner_id_category
msgid "Partner ID Category"
msgstr "ID categoria partner"
24 changes: 24 additions & 0 deletions partner_identification_eori/i18n/partner_identification_eori.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_identification_eori
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: partner_identification_eori
#: model:res.partner.id_category,name:partner_identification_eori.partner_identification_eori_number_category
msgid "EORI Identification Number"
msgstr ""

#. module: partner_identification_eori
#: model:ir.model,name:partner_identification_eori.model_res_partner_id_category
msgid "Partner ID Category"
msgstr ""
1 change: 1 addition & 0 deletions partner_identification_eori/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner_id_category
30 changes: 30 additions & 0 deletions partner_identification_eori/models/res_partner_id_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models


class ResPartnerIdCategory(models.Model):
_inherit = "res.partner.id_category"

def validate_res_partner_eori(self, id_number):
self.ensure_one()
if not id_number:
return False

if (
id_number.partner_id
and id_number.partner_id.country_id
and not id_number.name.startswith(id_number.partner_id.country_id.code)
):
return True

cat = self.env.ref(
"partner_identification_eori.partner_identification_eori_number_category"
).id
duplicate_eori = self._search_duplicate(cat, id_number, True)

if duplicate_eori:
return True

return False
3 changes: 3 additions & 0 deletions partner_identification_eori/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions partner_identification_eori/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Jordi Masvidal \<<jordi.masvidal@forgeflow.com>\>
- [Binhex](https://binhex.cloud/):
- Deriman Alonso
5 changes: 5 additions & 0 deletions partner_identification_eori/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This addon extends "Partner Identification Numbers" to provide a number
category for EORI Number.

see:
<https://taxation-customs.ec.europa.eu/customs-4/customs-procedures-import-and-export-0/customs-procedures/economic-operators-registration-and-identification-number-eori_en>
79 changes: 79 additions & 0 deletions partner_identification_eori/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading