Skip to content
Merged
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
95 changes: 95 additions & 0 deletions partner_identification_import/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============================
Partner Identification Import
=============================

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

.. |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/license-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%2Fedi-lightgray.png?logo=github
:target: https://github.com/OCA/edi/tree/19.0/partner_identification_import
:alt: OCA/edi
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/edi-19-0/edi-19-0-partner_identification_import
: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/edi&target_branch=19.0
:alt: Try me on Runboat

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

Glue module between base_business_document_import and
partner_identification (in OCA/partner-contact)

Allow to define extra partner ID (thanks to partner_identification) and
match the partner using for exemple the UBL PartyIdentification/ID

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/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/edi/issues/new?body=module:%20partner_identification_import%0Aversion:%2019.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
-------

* BCIM

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

- Jacques-Etienne Baudoux <je@bcim.be>

Trobz

- Dung Tran <dungtd@trobz.com>

Other credits
-------------

The development of this module has been 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/edi <https://github.com/OCA/edi/tree/19.0/partner_identification_import>`_ 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_import/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions partner_identification_import/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 Jacques-Etienne Baudoux <je@bcim.be>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Partner Identification Import",
"version": "19.0.1.0.0",
"category": "Tools",
"license": "AGPL-3",
"summary": "Provides partner matching on extra ID",
"author": "BCIM, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/edi",
"depends": [
"base_business_document_import",
# OCA/partner-contact
"partner_identification",
],
}
60 changes: 60 additions & 0 deletions partner_identification_import/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_identification_import
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-25 11:34+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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_import
#: model:ir.model,name:partner_identification_import.model_business_document_import
msgid "Common methods to import business documents"
msgstr "Métodos habituales para importar documentos comerciales"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import__id
msgid "ID"
msgstr "ID"

#. module: partner_identification_import
#: code:addons/partner_identification_import/models/business_document_import.py:0
#, python-format
msgid ""
"ID Number: {}\n"
"ID Number Category: {}\n"
"\n"
msgstr ""
"Número de identificación: {}\n"
"Categoría del número de identificación: {}\n"
"\n"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: partner_identification_import
#: code:addons/partner_identification_import/models/business_document_import.py:0
#, python-format
msgid ""
"Odoo couldn't find a partner corresponding to the following information extracted from the business document:\n"
"{}"
msgstr ""
"Odoo no pudo encontrar un socio correspondiente a la siguiente información "
"extraída del documento comercial:\n"
"{}"
60 changes: 60 additions & 0 deletions partner_identification_import/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_identification_import
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-06-17 06:39+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 5.10.4\n"

#. module: partner_identification_import
#: model:ir.model,name:partner_identification_import.model_business_document_import
msgid "Common methods to import business documents"
msgstr "Metodi comuni per l'importazione di documenti di lavoro"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import__id
msgid "ID"
msgstr "ID"

#. module: partner_identification_import
#: code:addons/partner_identification_import/models/business_document_import.py:0
#, python-format
msgid ""
"ID Number: {}\n"
"ID Number Category: {}\n"
"\n"
msgstr ""
"Numero ID: {}\n"
"Numero ID categoria: {}\n"
"\n"

#. module: partner_identification_import
#: model:ir.model.fields,field_description:partner_identification_import.field_business_document_import____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: partner_identification_import
#: code:addons/partner_identification_import/models/business_document_import.py:0
#, python-format
msgid ""
"Odoo couldn't find a partner corresponding to the following information extracted from the business document:\n"
"{}"
msgstr ""
"Odoo non trova un partner che corrisponda alle seguenti informazioni "
"estratte dal documento commerciale\n"
"{}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_identification_import
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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_import
#: model:ir.model,name:partner_identification_import.model_business_document_import
msgid "Common methods to import business documents"
msgstr ""

#. module: partner_identification_import
#. odoo-python
#: code:addons/partner_identification_import/models/business_document_import.py:0
msgid ""
"ID Number: %(value)s\n"
"ID Number Category: %(schemeID)s\n"
"\n"
msgstr ""

#. module: partner_identification_import
#. odoo-python
#: code:addons/partner_identification_import/models/business_document_import.py:0
msgid ""
"Odoo couldn't find a partner corresponding to the following information extracted from the business document:\n"
"{}"
msgstr ""
1 change: 1 addition & 0 deletions partner_identification_import/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import business_document_import
70 changes: 70 additions & 0 deletions partner_identification_import/models/business_document_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2020 Jacques-Etienne Baudoux <je@bcim.be>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, models
from odoo.fields import Domain


class BusinessDocumentImport(models.AbstractModel):
_inherit = "business.document.import"

@api.model
def _hook_match_partner(self, partner_dict, chatter_msg, domain, order):
# Loop on all the partner_dict["id_number"] and search for a partner
# having one. If the schemeID matches an existing Id Number Category,
# then a match is required.
schemeIDs = [
e["schemeID"] for e in partner_dict.get("id_number", []) if e["schemeID"]
]
if schemeIDs:
schemes = self.env["res.partner.id_category"].search(
Domain("code", "in", schemeIDs)
)
unmatched = []
for ident in partner_dict.get("id_number", []):
if ident.get("schemeID") not in schemes.mapped("code"):
continue
categ = schemes.filtered(lambda s, _id=ident: s.code == _id["schemeID"])
id_number = self.env["res.partner.id_number"].search(
Domain.AND(
[
Domain("category_id", "in", categ.ids),
Domain("name", "=", ident["value"]),
Domain("status", "!=", "close"),
]
),
limit=1,
)
if id_number:
partner = id_number.partner_id
# Search for a contact of this partner
domain = Domain.AND(
[
Domain("parent_id", "=", partner.id),
Domain("is_company", "=", False),
]
)
contact = self._match_partner_contact(
partner_dict, chatter_msg, domain, order
)
if contact:
return contact
return id_number.partner_id
unmatched.append(
self.env._(
"ID Number: %(value)s\nID Number Category: %(schemeID)s\n\n",
**ident,
)
)
if unmatched:
raise self.user_error_wrap(
"_hook_match_partner",
partner_dict,
self.env._(
"Odoo couldn't find a partner corresponding to the "
"following information extracted from the business document:\n"
"%(join_unmatched)s",
join_unmatched="or\n".join(unmatched),
),
)
return super()._hook_match_partner(partner_dict, chatter_msg, domain, order)
3 changes: 3 additions & 0 deletions partner_identification_import/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions partner_identification_import/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Jacques-Etienne Baudoux \<<je@bcim.be>\>

Trobz

- Dung Tran \<<dungtd@trobz.com>\>
3 changes: 3 additions & 0 deletions partner_identification_import/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The development of this module has been financially supported by:

- Camptocamp
5 changes: 5 additions & 0 deletions partner_identification_import/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Glue module between base_business_document_import and
partner_identification (in OCA/partner-contact)

Allow to define extra partner ID (thanks to partner_identification) and
match the partner using for exemple the UBL PartyIdentification/ID
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading