-
-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by JordiBForgeFlow
- Loading branch information
Showing
20 changed files
with
935 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
========================== | ||
Partner Identification GLN | ||
========================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:4f9199f709bfe2cd9ea90a46982c7a38e24314f962a527f77d83d65db2f5d156 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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_gln | ||
: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_gln | ||
: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 GLN registration | ||
|
||
see: http://www.gs1.org/1/glnrules/en/ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
This module depends on 'stdnum' python module | ||
|
||
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_gln%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 | ||
------- | ||
|
||
* Acsone S.A. | ||
|
||
Contributors | ||
------------ | ||
|
||
- Alvaro Estebanez <[email protected]> | ||
- Denis Roussel <[email protected]> | ||
- Meyomesse Gilles <[email protected]> | ||
- Bejaoui Souheil <[email protected]> | ||
- Simone Orsi <[email protected]> | ||
- Duong (Tran Quoc) <[email protected]> | ||
- Nils Coenen <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
||
The migration of this module from 14.0 to 16.0 was financially supported | ||
by Camptocamp. | ||
|
||
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_gln>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2016-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Partner Identification GLN", | ||
"summary": """ | ||
This addon extends "Partner Identification Numbers" | ||
to provide a number category for GLN registration""", | ||
"version": "18.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Acsone S.A.,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/partner-contact", | ||
"depends": ["partner_identification"], | ||
"data": ["data/partner_identification_gln.xml"], | ||
"installable": True, | ||
} |
24 changes: 24 additions & 0 deletions
24
partner_identification_gln/data/partner_identification_gln.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Copyright 2016-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
<odoo> | ||
<record | ||
id="partner_identification_gln_number_category" | ||
model="res.partner.id_category" | ||
> | ||
<field name="name">GLN Identification Number</field> | ||
<field name="code">gln_id_number</field> | ||
<field | ||
name="validation_code" | ||
><![CDATA[failed = self.validate_res_partner_gln(id_number)]]></field> | ||
</record> | ||
<record | ||
id="partner_identification_gcp_number_category" | ||
model="res.partner.id_category" | ||
> | ||
<field name="name">GCP Identification Number</field> | ||
<field name="code">gcp_id_number</field> | ||
<field | ||
name="validation_code" | ||
><![CDATA[failed = self.validate_res_partner_gcp(id_number)]]></field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_identification_gln | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-11-03 21:36+0000\n" | ||
"Last-Translator: Ivorra78 <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: es\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_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gcp_number_category | ||
msgid "GCP Identification Number" | ||
msgstr "Número de Identificación GCP" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gln_number_category | ||
msgid "GLN Identification Number" | ||
msgstr "Número de Identificación GLN" | ||
|
||
#. module: partner_identification_gln | ||
#: model:ir.model,name:partner_identification_gln.model_res_partner_id_category | ||
msgid "Partner ID Category" | ||
msgstr "Categoría ID de socio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_identification_gln | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-07-22 07:58+0000\n" | ||
"Last-Translator: mymage <[email protected]>\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 5.6.2\n" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gcp_number_category | ||
msgid "GCP Identification Number" | ||
msgstr "Numeri di identificazione GCP" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gln_number_category | ||
msgid "GLN Identification Number" | ||
msgstr "Numero di identificazione GLN" | ||
|
||
#. module: partner_identification_gln | ||
#: model:ir.model,name:partner_identification_gln.model_res_partner_id_category | ||
msgid "Partner ID Category" | ||
msgstr "ID categoria partner" |
29 changes: 29 additions & 0 deletions
29
partner_identification_gln/i18n/partner_identification_gln.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_identification_gln | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.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_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gcp_number_category | ||
msgid "GCP Identification Number" | ||
msgstr "" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gln_number_category | ||
msgid "GLN Identification Number" | ||
msgstr "" | ||
|
||
#. module: partner_identification_gln | ||
#: model:ir.model,name:partner_identification_gln.model_res_partner_id_category | ||
msgid "Partner ID Category" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_identification_gln | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-09-11 11:05+0000\n" | ||
"PO-Revision-Date: 2019-09-11 11:05+0000\n" | ||
"Last-Translator: Matjaž Mozetič <[email protected]>, 2017\n" | ||
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" | ||
"Language: sl\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " | ||
"n%100==4 ? 2 : 3);\n" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gcp_number_category | ||
msgid "GCP Identification Number" | ||
msgstr "GCP identifikacijska številka" | ||
|
||
#. module: partner_identification_gln | ||
#: model:res.partner.id_category,name:partner_identification_gln.partner_identification_gln_number_category | ||
msgid "GLN Identification Number" | ||
msgstr "GLN identifikacijska številka" | ||
|
||
#. module: partner_identification_gln | ||
#: model:ir.model,name:partner_identification_gln.model_res_partner_id_category | ||
msgid "Partner ID Category" | ||
msgstr "Partnerjeve ID kategorije" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import res_partner_id_category |
55 changes: 55 additions & 0 deletions
55
partner_identification_gln/models/res_partner_id_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2016-2017 ACSONE SA/NV (<http://acsone.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
import logging | ||
|
||
from odoo import models | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
try: | ||
from stdnum import ean | ||
from stdnum.exceptions import InvalidChecksum, InvalidFormat, InvalidLength | ||
except ImportError: | ||
_logger.debug("Cannot `import external dependency python stdnum package`.") | ||
|
||
|
||
class ResPartnerIdCategory(models.Model): | ||
_inherit = "res.partner.id_category" | ||
|
||
def validate_res_partner_gln(self, id_number): | ||
self.ensure_one() | ||
if not id_number: | ||
return False | ||
try: | ||
ean.validate(id_number.name) | ||
except (InvalidChecksum, InvalidFormat, InvalidLength): | ||
return True | ||
|
||
cat = self.env.ref( | ||
"partner_identification_gln." "partner_identification_gln_number_category" | ||
).id | ||
duplicate_gln = self._search_duplicate(cat, id_number, True) | ||
|
||
if duplicate_gln: | ||
return True | ||
|
||
return False | ||
|
||
def validate_res_partner_gcp(self, id_number): | ||
self.ensure_one() | ||
if not id_number: | ||
return False | ||
|
||
if len(id_number.name) < 1 or len(id_number.name) > 12: | ||
return True | ||
|
||
cat = self.env.ref( | ||
"partner_identification_gln." "partner_identification_gcp_number_category" | ||
).id | ||
duplicate_gln = self._search_duplicate(cat, id_number) | ||
|
||
if duplicate_gln: | ||
return True | ||
|
||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- Alvaro Estebanez \<<[email protected]>\> | ||
- Denis Roussel \<<[email protected]>\> | ||
- Meyomesse Gilles \<<[email protected]>\> | ||
- Bejaoui Souheil \<<[email protected]>\> | ||
- Simone Orsi \<<[email protected]>\> | ||
- Duong (Tran Quoc) \<<[email protected]>\> | ||
- Nils Coenen \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The migration of this module from 14.0 to 16.0 was financially supported | ||
by Camptocamp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This addon extends "Partner Identification Numbers" to provide a number | ||
category for GLN registration | ||
|
||
see: <http://www.gs1.org/1/glnrules/en/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module depends on 'stdnum' python module |
Oops, something went wrong.