Skip to content

Commit 7680fd4

Browse files
committed
Merge PR #1314 into 16.0
Signed-off-by sbejaoui
2 parents 6a33af9 + a49242e commit 7680fd4

16 files changed

Lines changed: 1094 additions & 0 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
====================================================
6+
Account Edi Ubl Cii Purchase Match Product Packaging
7+
====================================================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:aa1bb8c238590904cd7495d3d7e66d15c29020fd61c29dad0c06f3f06ec467cd
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
22+
:alt: License: AGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github
24+
:target: https://github.com/OCA/edi/tree/16.0/account_edi_ubl_cii_purchase_match_product_packaging
25+
:alt: OCA/edi
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/edi-16-0/edi-16-0-account_edi_ubl_cii_purchase_match_product_packaging
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=16.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
This module provides a fallback mechanism to recover the Unit of Measure
36+
(UoM) and product packaging during purchase line reconciliation of
37+
vendor bills imported from UBL/CII files.
38+
39+
It is a glue module between:
40+
41+
- Account Edi Ubl Cii Purchase Match
42+
- Account EDI UBL move line uom and packaging By UNECE
43+
44+
**Table of contents**
45+
46+
.. contents::
47+
:local:
48+
49+
Bug Tracker
50+
===========
51+
52+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/issues>`_.
53+
In case of trouble, please check there if your issue has already been reported.
54+
If you spotted it first, help us to smash it by providing a detailed and welcomed
55+
`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**>`_.
56+
57+
Do not contact contributors directly about support or help with technical issues.
58+
59+
Credits
60+
=======
61+
62+
Authors
63+
-------
64+
65+
* ACSONE SA/NV
66+
67+
Contributors
68+
------------
69+
70+
- Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu
71+
72+
Maintainers
73+
-----------
74+
75+
This module is maintained by the OCA.
76+
77+
.. image:: https://odoo-community.org/logo.png
78+
:alt: Odoo Community Association
79+
:target: https://odoo-community.org
80+
81+
OCA, or the Odoo Community Association, is a nonprofit organization whose
82+
mission is to support the collaborative development of Odoo features and
83+
promote its widespread use.
84+
85+
.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
86+
:target: https://github.com/sbejaoui
87+
:alt: sbejaoui
88+
89+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
90+
91+
|maintainer-sbejaoui|
92+
93+
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.
94+
95+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2026 ACSONE SA/NV
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Account Edi Ubl Cii Purchase Match Product Packaging",
6+
"summary": """Allows retrieving the correct UoM and packaging from UNECE codes
7+
when matching invoice lines with purchase orders""",
8+
"version": "16.0.1.0.0",
9+
"license": "AGPL-3",
10+
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/edi",
12+
"maintainers": ["sbejaoui"],
13+
"depends": [
14+
"account_edi_ubl_cii_purchase_match",
15+
"account_edi_ubl_move_line_uom_and_packaging_unece",
16+
],
17+
"data": [],
18+
"demo": [],
19+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import account_move_line
2+
from . import account_edi_xml_ubl_20
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2026 ACSONE SA/NV
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class AccountEdiXmlUbl_20(models.AbstractModel):
8+
9+
_inherit = "account.edi.xml.ubl_20"
10+
11+
def _import_fill_invoice_line_packaging(self, invoice_line):
12+
res = super()._import_fill_invoice_line_packaging(invoice_line)
13+
# force recomputation of the quantity
14+
# this is needed because after a second reconciliation with a purchase line,
15+
# the packaging may remain the same while the underlying quantity changes
16+
# without this explicit call, the computed quantity may become inconsistent
17+
invoice_line._compute_quantity()
18+
return res
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2026 ACSONE SA/NV
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class AccountMoveLine(models.Model):
8+
9+
_inherit = "account.move.line"
10+
11+
def _set_product(self, product):
12+
self.ensure_one()
13+
res = super()._set_product(product)
14+
15+
if self.ubl_unece_unit_code:
16+
if not self.env[
17+
"account.edi.xml.ubl_20"
18+
]._import_fill_invoice_line_packaging(self):
19+
self.env["account.edi.xml.ubl_20"]._import_fill_invoice_line_uom(self)
20+
return res
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Souheil Bejaoui - ACSONE SA/NV <souheil.bejaoui@acsone.eu>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This module provides a fallback mechanism to recover the Unit of Measure (UoM)
2+
and product packaging during purchase line reconciliation of vendor bills
3+
imported from UBL/CII files.
4+
5+
It is a glue module between:
6+
- Account Edi Ubl Cii Purchase Match
7+
- Account EDI UBL move line uom and packaging By UNECE
9.23 KB
Loading

0 commit comments

Comments
 (0)