Skip to content
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
95 changes: 95 additions & 0 deletions account_edi_ubl_cii_purchase_match_product_packaging/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

====================================================
Account Edi Ubl Cii Purchase Match Product Packaging
====================================================

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

.. |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/16.0/account_edi_ubl_cii_purchase_match_product_packaging
:alt: OCA/edi
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/edi-16-0/edi-16-0-account_edi_ubl_cii_purchase_match_product_packaging
: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=16.0
:alt: Try me on Runboat

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

This module provides a fallback mechanism to recover the Unit of Measure
(UoM) and product packaging during purchase line reconciliation of
vendor bills imported from UBL/CII files.

It is a glue module between:

- Account Edi Ubl Cii Purchase Match
- Account EDI UBL move line uom and packaging By UNECE

**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:%20account_edi_ubl_cii_purchase_match_product_packaging%0Aversion:%2016.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 SA/NV

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

- Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu

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.

.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

This module is part of the `OCA/edi <https://github.com/OCA/edi/tree/16.0/account_edi_ubl_cii_purchase_match_product_packaging>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Account Edi Ubl Cii Purchase Match Product Packaging",
"summary": """Allows retrieving the correct UoM and packaging from UNECE codes
when matching invoice lines with purchase orders""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/edi",
"maintainers": ["sbejaoui"],
"depends": [
"account_edi_ubl_cii_purchase_match",
"account_edi_ubl_move_line_uom_and_packaging_unece",
],
"data": [],
"demo": [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import account_move_line
from . import account_edi_xml_ubl_20
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class AccountEdiXmlUbl_20(models.AbstractModel):

_inherit = "account.edi.xml.ubl_20"

def _import_fill_invoice_line_packaging(self, invoice_line):
res = super()._import_fill_invoice_line_packaging(invoice_line)
# force recomputation of the quantity
# this is needed because after a second reconciliation with a purchase line,
# the packaging may remain the same while the underlying quantity changes
# without this explicit call, the computed quantity may become inconsistent
invoice_line._compute_quantity()
return res
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class AccountMoveLine(models.Model):

_inherit = "account.move.line"

def _set_product(self, product):
self.ensure_one()
res = super()._set_product(product)

if self.ubl_unece_unit_code:
if not self.env[
"account.edi.xml.ubl_20"
]._import_fill_invoice_line_packaging(self):
self.env["account.edi.xml.ubl_20"]._import_fill_invoice_line_uom(self)
return res
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Souheil Bejaoui - ACSONE SA/NV <souheil.bejaoui@acsone.eu>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module provides a fallback mechanism to recover the Unit of Measure (UoM)
and product packaging during purchase line reconciliation of vendor bills
imported from UBL/CII files.

It is a glue module between:
- Account Edi Ubl Cii Purchase Match
- Account EDI UBL move line uom and packaging By UNECE
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading