-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
794 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
account_invoice_import_facturx/tests/files/* | ||
product_import_ubl/tests/files/* |
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 @@ | ||
================== | ||
Product UBL Import | ||
================== |
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 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import wizard |
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,16 @@ | ||
# Copyright 2022 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Product UBL Import", | ||
"version": "14.0.1.0.0", | ||
"development_status": "Alpha", | ||
"license": "AGPL-3", | ||
"summary": "Import UBL XML catalogue files", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/edi", | ||
"depends": [ | ||
"base_ubl", | ||
"product_import", | ||
], | ||
} |
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 @@ | ||
* Florent Xicluna <[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 @@ | ||
This module adds support for the import of product catalogues that comply with the `Universal Business Language (UBL) <http://ubl.xml.org/>`_ standard. The UBL standard became the `ISO/IEC 19845 <http://www.iso.org/iso/catalogue_detail.htm?csnumber=66370>`_ standard in December 2015 (cf the `official announce <http://www.prweb.com/releases/2016/01/prweb13186919.htm>_`). |
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 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_ubl_catalogue_import |
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,118 @@ | ||
# Copyright 2022 Camptocamp | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
import base64 | ||
from functools import partial | ||
|
||
from odoo.tools import DotDict, file_open | ||
|
||
|
||
def _as_base64(filename): | ||
path = f"product_import_ubl/tests/files/{filename}" | ||
with file_open(path, "rb") as fobj: | ||
data = fobj.read() | ||
return base64.b64encode(data) | ||
|
||
|
||
def get_test_data(env): | ||
ref = env.ref | ||
return { | ||
"UBL-Catalogue_Example.xml": DotDict( | ||
{ | ||
"_as_base64": partial(_as_base64, "UBL-Catalogue_Example.xml"), | ||
"products": [ | ||
{ | ||
"active": True, | ||
"name": "Copy paper", | ||
"code": "MNTR011", | ||
"barcode": False, | ||
"product_code": "MNTR01349087911", | ||
"description": "Photo copy paper 80g A4, package of 500 sheets.", | ||
"uom": ref("uom.product_uom_lb"), | ||
"currency": ref("base.EUR"), | ||
"min_qty": 1.0, | ||
"price": 10.0, | ||
"company": False, | ||
}, | ||
{ | ||
"active": True, | ||
"name": "Copy paper", | ||
"code": "MNTR012", | ||
"barcode": False, | ||
"product_code": "MNTR01349087912", | ||
"description": ( | ||
"Photo copy paper 80g A4, carton of 10 units " | ||
"with 500 sheets each" | ||
), | ||
"uom": ref("uom.product_uom_unit"), | ||
"currency": ref("base.EUR"), | ||
"min_qty": 0.0, | ||
"price": 90.0, | ||
"company": False, | ||
}, | ||
], | ||
} | ||
), | ||
"UBL-Catalogue_Example2.xml": DotDict( | ||
{ | ||
"_as_base64": partial(_as_base64, "UBL-Catalogue_Example2.xml"), | ||
"products": [ | ||
{ | ||
"active": True, | ||
"name": "First product", | ||
"code": "998000924", | ||
"barcode": "1234567890924", | ||
"product_code": "BOCAP-B", | ||
"description": False, | ||
"uom": ref("uom.product_uom_unit"), | ||
"currency": ref("base.EUR"), | ||
"min_qty": 1.0, | ||
"price": 1.35, | ||
"company": ref("base.main_company"), | ||
}, | ||
{ | ||
"active": True, | ||
"name": "Copy paper", | ||
"code": "MNTR011X1", | ||
"barcode": "1234567890114", | ||
"product_code": "MNTR01349087911", | ||
"description": "Photo copy paper 80g A4, package of 500 sheets.", | ||
"uom": ref("uom.product_uom_unit"), | ||
"currency": ref("base.EUR"), | ||
"min_qty": 1.0, | ||
"price": 12.55, | ||
"company": ref("base.main_company"), | ||
}, | ||
{ | ||
"active": True, | ||
"name": "Copy paper", | ||
"code": "MNTR012X2", | ||
"barcode": "1234567890124", | ||
"product_code": "MNTR01349087912", | ||
"description": ( | ||
"Photo copy paper 80g A4, carton of 10 units " | ||
"with 500 sheets each" | ||
), | ||
"uom": ref("uom.product_uom_unit"), | ||
"currency": ref("base.EUR"), | ||
"min_qty": 20.0, | ||
"price": 91.5, | ||
"company": ref("base.main_company"), | ||
}, | ||
{ | ||
"active": False, | ||
"name": "Copy paper, outdated", | ||
"code": "MNTR010X9", | ||
"barcode": False, | ||
"product_code": False, | ||
"description": False, | ||
"uom": ref("uom.product_uom_unit"), | ||
"currency": ref("base.USD"), | ||
"min_qty": 0.0, | ||
"price": 0.0, | ||
"company": ref("base.main_company"), | ||
}, | ||
], | ||
} | ||
), | ||
} |
Oops, something went wrong.