From f80e4d1ebe0788c7a6b7703dec9ef6cc1fc3b385 Mon Sep 17 00:00:00 2001 From: FrankC013 Date: Mon, 17 Feb 2025 18:35:13 +0100 Subject: [PATCH] [ADD] lighting_export_bmecat --- lighting_export_bmecat/README.rst | 62 + lighting_export_bmecat/__init__.py | 2 + lighting_export_bmecat/__manifest__.py | 23 + .../data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd | 2575 +++++++++++++++++ lighting_export_bmecat/models/__init__.py | 5 + .../models/lighting_bmecat.py | 39 + .../lighting_bmecat_logistic_details.py | 60 + .../models/lighting_bmecat_mime_code.py | 130 + .../models/lighting_bmecat_packing_unit.py | 73 + .../models/lighting_export_bmecat.py | 202 ++ .../readme/CONTRIBUTORS.rst | 3 + lighting_export_bmecat/readme/DESCRIPTION.rst | 1 + .../security/ir.model.access.csv | 11 + .../security/lighting_bmecat_rule.xml | 9 + .../static/description/icon.png | Bin 0 -> 6342 bytes .../static/description/index.html | 418 +++ .../views/lighting_bmecat_views.xml | 73 + .../views/lighting_export_bmecat_views.xml | 87 + .../views/product_catalog_views.xml | 19 + .../views/report_bmecat.xml | 224 ++ lighting_export_bmecat/wizard/__init__.py | 0 .../wizard/lighting_bmecat_wizard_views.xml | 49 + .../odoo/addons/lighting_export_bmecat | 1 + setup/lighting_export_bmecat/setup.py | 6 + 24 files changed, 4072 insertions(+) create mode 100644 lighting_export_bmecat/README.rst create mode 100644 lighting_export_bmecat/__init__.py create mode 100644 lighting_export_bmecat/__manifest__.py create mode 100644 lighting_export_bmecat/data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd create mode 100644 lighting_export_bmecat/models/__init__.py create mode 100644 lighting_export_bmecat/models/lighting_bmecat.py create mode 100644 lighting_export_bmecat/models/lighting_bmecat_logistic_details.py create mode 100644 lighting_export_bmecat/models/lighting_bmecat_mime_code.py create mode 100644 lighting_export_bmecat/models/lighting_bmecat_packing_unit.py create mode 100644 lighting_export_bmecat/models/lighting_export_bmecat.py create mode 100644 lighting_export_bmecat/readme/CONTRIBUTORS.rst create mode 100644 lighting_export_bmecat/readme/DESCRIPTION.rst create mode 100644 lighting_export_bmecat/security/ir.model.access.csv create mode 100644 lighting_export_bmecat/security/lighting_bmecat_rule.xml create mode 100644 lighting_export_bmecat/static/description/icon.png create mode 100644 lighting_export_bmecat/static/description/index.html create mode 100644 lighting_export_bmecat/views/lighting_bmecat_views.xml create mode 100644 lighting_export_bmecat/views/lighting_export_bmecat_views.xml create mode 100644 lighting_export_bmecat/views/product_catalog_views.xml create mode 100644 lighting_export_bmecat/views/report_bmecat.xml create mode 100644 lighting_export_bmecat/wizard/__init__.py create mode 100644 lighting_export_bmecat/wizard/lighting_bmecat_wizard_views.xml create mode 120000 setup/lighting_export_bmecat/odoo/addons/lighting_export_bmecat create mode 100644 setup/lighting_export_bmecat/setup.py diff --git a/lighting_export_bmecat/README.rst b/lighting_export_bmecat/README.rst new file mode 100644 index 000000000..f4d6fa811 --- /dev/null +++ b/lighting_export_bmecat/README.rst @@ -0,0 +1,62 @@ +====================== +Lighting Export BMEcat +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3c4da51cf6c645b6074d760f70a7b95c24bf6a15a9ae55d8162730670e9a1987 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-NuoBiT%2Flighting--vertical-lightgray.png?logo=github + :target: https://github.com/NuoBiT/lighting-vertical/tree/16.0/lighting_export_bmecat + :alt: NuoBiT/lighting-vertical + +|badge1| |badge2| |badge3| + +This module adds the function generate_generic_name for display names models + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* NuoBiT Solutions SL + +Contributors +~~~~~~~~~~~~ + +* `NuoBiT `__: + + * Frank Cespedes + +Maintainers +~~~~~~~~~~~ + +This module is part of the `NuoBiT/lighting-vertical `_ project on GitHub. + +You are welcome to contribute. diff --git a/lighting_export_bmecat/__init__.py b/lighting_export_bmecat/__init__.py new file mode 100644 index 000000000..9b4296142 --- /dev/null +++ b/lighting_export_bmecat/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/lighting_export_bmecat/__manifest__.py b/lighting_export_bmecat/__manifest__.py new file mode 100644 index 000000000..a74f8943e --- /dev/null +++ b/lighting_export_bmecat/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +{ + "name": "Lighting Export BMEcat", + "version": "16.0.1.0.0", + "author": "NuoBiT Solutions SL", + "license": "AGPL-3", + "category": "Lighting", + "website": "https://github.com/NuoBiT/lighting-vertical", + "depends": ["lighting", "report_xml"], + "data": [ + "security/ir.model.access.csv", + "security/lighting_bmecat_rule.xml", + "views/lighting_export_bmecat_views.xml", + "views/lighting_bmecat_views.xml", + "wizard/lighting_bmecat_wizard_views.xml", + "views/product_catalog_views.xml", + "views/report_bmecat.xml", + ], + "external_dependencies": { + "python": ["pycountry"], + }, +} diff --git a/lighting_export_bmecat/data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd b/lighting_export_bmecat/data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd new file mode 100644 index 000000000..94964fe66 --- /dev/null +++ b/lighting_export_bmecat/data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd @@ -0,0 +1,2575 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lighting_export_bmecat/models/__init__.py b/lighting_export_bmecat/models/__init__.py new file mode 100644 index 000000000..cc1c9b8b0 --- /dev/null +++ b/lighting_export_bmecat/models/__init__.py @@ -0,0 +1,5 @@ +from . import lighting_export_bmecat +from . import lighting_bmecat +from . import lighting_bmecat_packing_unit +from . import lighting_bmecat_mime_code +from . import lighting_bmecat_logistic_details diff --git a/lighting_export_bmecat/models/lighting_bmecat.py b/lighting_export_bmecat/models/lighting_bmecat.py new file mode 100644 index 000000000..ecc545b37 --- /dev/null +++ b/lighting_export_bmecat/models/lighting_bmecat.py @@ -0,0 +1,39 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import fields, models + + +class LightingBMEcat(models.Model): + _name = "lighting.bmecat" + _description = "Lighting BMEcat" + + name = fields.Char() + version = fields.Selection( + selection=[ + ("etim_5_0", "BMEcat_ETIM_5.0"), + ], + required=True, + default="etim_5_0", + ) + state_marketing_filter = fields.Many2many( + "ir.model.fields.selection", + string="Marketing Status Filter", + domain=[ + ("field_id.model", "=", "lighting.product"), + ("field_id.name", "=", "state_marketing"), + ], + help="Select marketing states to filter products during export.", + ) + packing_unit_ids = fields.One2many( + comodel_name="lighting.bmecat.packing.unit", + inverse_name="bmecat_id", + ) + mime_code_ids = fields.One2many( + comodel_name="lighting.bmecat.mime.code", + inverse_name="bmecat_id", + ) + logistic_details_ids = fields.One2many( + comodel_name="lighting.bmecat.logistic.details", + inverse_name="bmecat_id", + ) diff --git a/lighting_export_bmecat/models/lighting_bmecat_logistic_details.py b/lighting_export_bmecat/models/lighting_bmecat_logistic_details.py new file mode 100644 index 000000000..92a3f0ea7 --- /dev/null +++ b/lighting_export_bmecat/models/lighting_bmecat_logistic_details.py @@ -0,0 +1,60 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class LightingBMEcatLogisticDetails(models.Model): + _name = "lighting.bmecat.logistic.details" + _description = "Lighting BMEcat Logistic Details" + + bmecat_id = fields.Many2one(comodel_name="lighting.bmecat", required=True) + dimension = fields.Selection( + selection=[ + ("net_volume", "Net Volume"), + ("net_weight", "Net Weight"), + ("net_length", "Net Length"), + ("net_width", "Net Width"), + ("net_depth", "Net Depth"), + ("net_diameter", "Net Diameter"), + ], + string=" Dimension BMEcat", + required=True, + ) + uom_category_id = fields.Many2one(comodel_name="uom.category", required=True) + uom = fields.Selection( + selection=[ + ("kg", "Kilogram (kg)"), + ("m", "Meter (m)"), + ("m³", "Cubic Meter (m³)"), + ], + compute="_compute_uom", + store=True, + ) + + @api.depends("dimension") + def _compute_uom(self): + for rec in self: + if rec.dimension: + if rec.dimension == "net_volume": + rec.uom = "m³" + elif rec.dimension == "net_weight": + rec.uom = "kg" + else: + rec.uom = "m" + else: + rec.uom = False + + @api.constrains("uom_category_id") + def _check_uom(self): + for rec in self: + duplicate = rec.search( + [ + ("bmecat_id", "=", rec.bmecat_id.id), + ("uom_category_id", "=", rec.uom_category_id.id), + ("id", "!=", rec.id), + ] + ) + if duplicate: + raise ValidationError(_("UOM category already exists in this BMEcat.")) diff --git a/lighting_export_bmecat/models/lighting_bmecat_mime_code.py b/lighting_export_bmecat/models/lighting_bmecat_mime_code.py new file mode 100644 index 000000000..cbb1fedf6 --- /dev/null +++ b/lighting_export_bmecat/models/lighting_bmecat_mime_code.py @@ -0,0 +1,130 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + +_logger = logging.getLogger(__name__) + + +class LightingBMEcatMimeCode(models.Model): + _name = "lighting.bmecat.mime.code" + _description = "Lighting BMEcat Mime Code" + + bmecat_id = fields.Many2one( + comodel_name="lighting.bmecat", + required=True, + ondelete="cascade", + ) + code = fields.Selection( + selection=[ + ("MD01", "MD01 - Product picture"), + ("MD02", "MD02 - Similar figure"), + ("MD03", "MD03 - Safety data sheet"), + ("MD04", "MD04 - Deeplink product page"), + ("MD05", "MD05 - Declaration REACH"), + ("MD06", "MD06 - Energy label"), + ("MD07", "MD07 - Product data sheet for energy label"), + ("MD08", "MD08 - Calibration certificate"), + ("MD09", "MD09 - Certificate"), + ("MD10", "MD10 - Circuit diagram"), + ("MD11", "MD11 - Construction Products Regulation"), + ("MD12", "MD12 - Dimensioned drawing"), + ("MD13", "MD13 - Environment label"), + ("MD14", "MD14 - Instructions for use"), + ("MD15", "MD15 - Light cone diagram"), + ("MD16", "MD16 - Light Distribution Curve"), + ("MD17", "MD17 - Logo 1c"), + ("MD18", "MD18 - Logo 4c"), + ("MD19", "MD19 - Luminaire data"), + ("MD20", "MD20 - Ambient picture"), + ("MD21", "MD21 - Mounting instruction"), + ("MD22", "MD22 - Product data sheet"), + ("MD23", "MD23 - Product picture back view"), + ("MD24", "MD24 - Product picture bottom view"), + ("MD25", "MD25 - Product picture detailed view"), + ("MD26", "MD26 - Product picture front view"), + ("MD27", "MD27 - Product picture sloping"), + ("MD28", "MD28 - Product picture top view"), + ("MD29", "MD29 - Product picture view from the left side"), + ("MD30", "MD30 - Product picture view from the right side"), + ("MD31", "MD31 - Seal of approval"), + ("MD32", "MD32 - Technical information"), + ("MD33", "MD33 - Test approval"), + ("MD34", "MD34 - Wiring diagram"), + ( + "MD35", + "MD35 - Supplier’s declaration for products having" + " preferential origin status", + ), + ("MD37", "MD37 - 3D / BIM object"), + ("MD38", "MD38 - Management, operation and maintenance document"), + ("MD39", "MD39 - Instructional video"), + ("MD40", "MD40 - Spare parts list"), + ("MD41", "MD41 - Sales brochure"), + ( + "MD42", + "MD42 - AVCP certificate (Assessment and Verification " + "of Constancy of Performance)", + ), + ("MD43", "MD43 - CLP (Classification, Labelling and Packaging)"), + ("MD44", "MD44 - ECOP (Environmental Code of Practice)"), + ("MD45", "MD45 - Product video"), + ("MD46", "MD46 - 360° view"), + ("MD47", "MD47 - Thumbnail of Product picture (MD01)"), + ("MD48", "MD48 - Pictogram/Icon"), + ("MD49", "MD49 - Declaration RoHS"), + ( + "MD50", + "MD50 - Declaration CoC (Certificate of Conformity, requested for CPR)", + ), + ("MD51", "MD51 - Declaration DOP (Declaration of performance)"), + ("MD52", "MD52 - Declaration DOC CE (Declaration of conformity CE)"), + ("MD53", "MD53 - Declaration BREEAM"), + ("MD54", "MD54 - Declaration EPD (Environmental Product Declaration)"), + ("MD55", "MD55 - Declaration ETA (European Technical Assessment)"), + ("MD56", "MD56 - Declaration warranty (Warranty statement)"), + ("MD57", "MD57 - Application video"), + ("MD58", "MD58 - Question and Answer (Q&A video)"), + ("MD59", "MD59 - Product picture square format"), + ("MD60", "MD60 - Exploded view drawing"), + ("MD61", "MD61 - Flowchart"), + ("MD62", "MD62 - Product presentation"), + ("MD63", "MD63 - Specification text"), + ("MD64", "MD64 - Line drawing"), + ("MD65", "MD65 - Product family view"), + ("MD99", "MD99 - Others"), + ], + string="MIME Code", + required=True, + ) + type_id = fields.Many2one(comodel_name="lighting.attachment.type", required=True) + + @api.constrains("code", "type_id", "bmecat_id") + def _check_unique_code_and_type(self): + for rec in self: + duplicate_code = self.search( + [ + ("bmecat_id", "=", rec.bmecat_id.id), + ("code", "=", rec.code), + ("id", "!=", rec.id), + ] + ) + if duplicate_code: + raise ValidationError( + _("The MIME Code '%s' is already assigned to this BMEcat.") + % rec.code + ) + duplicate_type = self.search( + [ + ("bmecat_id", "=", rec.bmecat_id.id), + ("type_id", "=", rec.type_id.id), + ("id", "!=", rec.id), + ] + ) + if duplicate_type: + raise ValidationError( + _("The MIME Type '%s' is already assigned to this BMEcat.") + % rec.type_id.name + ) diff --git a/lighting_export_bmecat/models/lighting_bmecat_packing_unit.py b/lighting_export_bmecat/models/lighting_bmecat_packing_unit.py new file mode 100644 index 000000000..f049a3c06 --- /dev/null +++ b/lighting_export_bmecat/models/lighting_bmecat_packing_unit.py @@ -0,0 +1,73 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + +_logger = logging.getLogger(__name__) + + +class LightingBMEcatPackingUnit(models.Model): + _name = "lighting.bmecat.packing.unit" + _description = "Lighting BMEcat Packing Unit" + + bmecat_id = fields.Many2one(comodel_name="lighting.bmecat", required=True) + code = fields.Selection( + selection=[ + ("BE", "BE - Bundle"), + ("BG", "BG - Bag"), + ("BO", "BO - Bottle"), + ("BX", "BX - Box"), + ("C62", "C62 - One (unit)"), + ("CA", "CA - Can"), + ("CL", "CL - Coil"), + ("CQ", "CQ - Cartridge"), + ("CR", "CR - Crate"), + ("CS", "CS - Case"), + ("CT", "CT - Carton"), + ("CY", "CY - Cylinder"), + ("D99", "D99 - Sleeve"), + ("DR", "DR - Drum"), + ("EV", "EV - Envelope"), + ("KG", "KG - Keg"), + ("NE", "NE - Unpacked *"), + ("PA", "PA - Packet"), + ("PF", "PF - Pallet (lift)"), + ("PK", "PK - Pack"), + ("PL", "PL - Pail"), + ("PR", "PR - Pair"), + ("PU", "PU - Tray / tray pack"), + ("RG", "RG - Ring"), + ("RL", "RL - Reel"), + ("RO", "RO - Roll"), + ("SA", "SA - Sack"), + ("SET", "SET - Set"), + ("TN", "TN - Tin"), + ("TU", "TU - Tube"), + ("WR", "WR - Wrap"), + ("Z2", "Z2 - Chest"), + ("Z3", "Z3 - Cask"), + ], + string="Packing Code", + required=True, + ) + uom_id = fields.Many2one(comodel_name="uom.uom", required=True) + + @api.constrains("uom_id") + def _check_unique_uom_id(self): + for rec in self: + duplicate = self.search( + [ + ("bmecat_id", "=", rec.bmecat_id.id), + ("uom_id", "=", rec.uom_id.id), + ("id", "!=", rec.id), + ] + ) + if duplicate: + raise ValidationError( + _( + "The same Unit of Measure (UoM) cannot be used " + "more than once in the same BMEcat." + ) + ) diff --git a/lighting_export_bmecat/models/lighting_export_bmecat.py b/lighting_export_bmecat/models/lighting_export_bmecat.py new file mode 100644 index 000000000..0fdca5364 --- /dev/null +++ b/lighting_export_bmecat/models/lighting_export_bmecat.py @@ -0,0 +1,202 @@ +# Copyright NuoBiT Solutions - Frank Cespedes +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +import base64 +import logging + +from pycountry import languages +from xlrd.xlsx import ET + +from odoo import _, api, fields, models, tools +from odoo.exceptions import ValidationError + +# from ..data.BMEcat_ETIM_5 import bmecat_etim_501 + +_logger = logging.getLogger(__name__) + + +class LightingExportBMEcat(models.Model): + _name = "lighting.export.bmecat" + _description = "Lighting Export BMEcat" + + def _states_attachments(self): + return [ + ("draft", _("Draft")), + ("exported", _("Exported")), + ] + + name = fields.Char(required=True) + date = fields.Date(default=fields.Date.today) + bmecat_id = fields.Many2one(comodel_name="lighting.bmecat", required=True) + catalog_id = fields.Many2one(comodel_name="lighting.catalog", required=True) + create_job = fields.Boolean() + state = fields.Selection( + selection="_states_attachments", + default="draft", + required=True, + ) + bmecat_file = fields.Binary(string="BMEcat File") + bmecat_fname = fields.Char(string="BMEcat Filename") + company_id = fields.Many2one( + comodel_name="res.company", + required=True, + default=lambda self: self.env.company, + ) + valid_start_date = fields.Date(required=True) + language = fields.Many2one(comodel_name="res.lang", required=True) + lang_iso392_2 = fields.Char(compute="_compute_lang_iso392_2") + + def _compute_lang_iso392_2(self): + for rec in self: + rec.lang_iso392_2 = languages.get(alpha_2=rec.language.iso_code).alpha_3 + + catalog_version = fields.Char( + compute="_compute_catalog_version", store=True, readonly=False + ) + + def _compute_catalog_version(self): + for rec in self: + rec.catalog_version = "{:03d}.000".format(rec.valid_start_date.year % 1000) + + @api.constrains("catalog_version") + def _check_catalog_version(self): + for rec in self: + if len(rec.catalog_version) != 7: + raise ValidationError( + _( + "The catalog version is not correct. It " + "should be in the format 'XXX.XXX'" + ) + ) + + @api.constrains("bmecat_file") + def _check_bmecat_file(self): + for rec in self: + if rec.state == "exported" and not rec.bmecat_file: + raise ValidationError( + _("An exported record must have a valid BMEcat file attached.") + ) + + def get_mime_code(self, attachment): + mime_code = self.bmecat_id.mime_code_ids.filtered( + lambda x: x.type_id == attachment.type_id + ) + # TODO: Check if this is necessary + # if not mime_code: + # raise ValidationError( + # _( + # "There is no mime code associated with the attachment type %s " + # "(Code: %s) in the BMECat configuration for product %s (ID: %s)," + # " attachment %s (ID: %s)." + # ) + # % ( + # attachment.type_id.name, + # attachment.type_id.code, + # attachment.product_id.reference, + # attachment.product_id.id, + # attachment.name, + # attachment.id, + # ) + # ) + return mime_code.code + + def get_packing_unit(self, product): + uom = product.product_variant_id.uom_id + packing_unit = self.bmecat_id.packing_unit_ids.filtered( + lambda x: x.uom_id == uom + ) + if not packing_unit: + raise ValidationError( + _( + "There is no packing unit associated with the product measurement " + "unit %s in the BMECat configuration." + ) + % uom.name + ) + return packing_unit.code + + def get_logistic_value(self, product, dimension_type): + logistic_value = self.bmecat_id.logistic_details_ids.filtered( + lambda x: x.dimension == dimension_type + ) + dimension = product.dimension_ids.filtered( + lambda x: x.type_id.uom_id in logistic_value.uom_category_id.uom_ids + and x.value + ) + if len(dimension) > 1: + raise ValidationError(_("error %s") % product.id) + value = dimension.value + if dimension: + if logistic_value.uom != dimension.type_id.uom_id.name: + uom_correct = dimension.type_id.uom_id.category_id.uom_ids.filtered( + lambda x: x.name == logistic_value.uom + ) + # TODO: Check if this is necessary + # if not uom_correct: + # raise ValidationError( + # _( + # "There is no logistic value associated with the product " + # "%s (ID: %s) for the uom %s in the BMECat configuration." + # ) + # % (product.reference, product.id, logistic_value.uom) + # ) + value = dimension.type_id.uom_id._compute_quantity(value, uom_correct) + return value + + def _get_bmecat_schema_file(self): + if self.bmecat_id.version == "etim_5_0": + return tools.file_open( + "lighting_export_bmecat/data/BMEcat_ETIM_5.0/bmecat_etim_501.xsd" + ) + else: + raise ValidationError(_("The BMECat version is not supported.")) + + def validate_xml_with_xsd(self, xml_content): + schema_file = self._get_bmecat_schema_file() + if not schema_file: + raise ValidationError(_("Not found XSD file to validate the XML.")) + try: + schema_doc = ET.parse(schema_file) + schema = ET.XMLSchema(schema_doc) + xml_doc = ET.fromstring(xml_content) + schema.assertValid(xml_doc) + _logger.info("XML validated successfully against the XSD.") + except Exception as e: + raise ValidationError( + _("Unexpected error while validating XML:\n%s") % str(e) + ) from e + + def _check_bmecat_file_values(self): + self.ensure_one() + if not self.catalog_id.code: + raise ValidationError(_("The catalog must have a code.")) + + def generate_bmecat_file(self): + self._check_bmecat_file_values() + bmecat_file = self.env.ref( + "lighting_export_bmecat.action_report_bmecat" + )._render("lighting_export_bmecat.action_report_bmecat", self.ids)[0] + self.validate_xml_with_xsd(bmecat_file) + file_name = ("BMEcat" + self.name + ".xml").replace("/", "-") + file = base64.b64encode(bmecat_file) + attachment = self.env["ir.attachment"].create( + { + "name": file_name, + "datas": file, + "res_model": "lighting.bmecat", + "res_id": self.id, + "mimetype": "application/xml", + } + ) + _logger.info(_("Export successful\n\nCatalog: %s\n") % self.catalog_id.name) + self.write( + { + "bmecat_file": file, + "bmecat_fname": file_name, + "state": "exported", + } + ) + return { + "type": "ir.actions.act_url", + "url": f"/web/content/{attachment.id}?download=true", + "target": "self", + } diff --git a/lighting_export_bmecat/readme/CONTRIBUTORS.rst b/lighting_export_bmecat/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..277078c8e --- /dev/null +++ b/lighting_export_bmecat/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `NuoBiT `__: + + * Frank Cespedes diff --git a/lighting_export_bmecat/readme/DESCRIPTION.rst b/lighting_export_bmecat/readme/DESCRIPTION.rst new file mode 100644 index 000000000..50bf4f2e8 --- /dev/null +++ b/lighting_export_bmecat/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds the function generate_generic_name for display names models diff --git a/lighting_export_bmecat/security/ir.model.access.csv b/lighting_export_bmecat/security/ir.model.access.csv new file mode 100644 index 000000000..bf1ad93b1 --- /dev/null +++ b/lighting_export_bmecat/security/ir.model.access.csv @@ -0,0 +1,11 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_lighting_export_bmecat_manager,lighting.export.bmecat manager,model_lighting_export_bmecat,lighting.group_lighting_manager,1,1,1,1 +access_lighting_export_bmecat_user,lighting.export.bmecat user,model_lighting_export_bmecat,lighting.group_lighting_user,1,0,0,0 +access_lighting_bmecat_manager,lighting.bmecat manager,model_lighting_bmecat,lighting.group_lighting_manager,1,1,1,1 +access_lighting_bmecat_user,lighting.bmecat user,model_lighting_bmecat,lighting.group_lighting_user,1,0,0,0 +access_lighting_bmecat_packing_unit_manager,lighting.bmecat.packing.unit manager,model_lighting_bmecat_packing_unit,lighting.group_lighting_manager,1,1,1,1 +access_lighting_bmecat_packing_unit_user,lighting.bmecat.packing.unit user,model_lighting_bmecat_packing_unit,lighting.group_lighting_user,1,0,0,0 +access_lighting_bmecat_mime_code_manager,lighting.bmecat.mime.code manager,model_lighting_bmecat_mime_code,lighting.group_lighting_manager,1,1,1,1 +access_lighting_bmecat_mime_code_user,lighting.bmecat.mime.code user,model_lighting_bmecat_mime_code,lighting.group_lighting_user,1,0,0,0 +access_lighting_bmecat_logistic_details_manager,lighting.bmecat.logistic.details manager,model_lighting_bmecat_logistic_details,lighting.group_lighting_manager,1,1,1,1 +access_lighting_bmecat_logistic_details_user,lighting.bmecat.logistic.details user,model_lighting_bmecat_logistic_details,lighting.group_lighting_user,1,0,0,0 diff --git a/lighting_export_bmecat/security/lighting_bmecat_rule.xml b/lighting_export_bmecat/security/lighting_bmecat_rule.xml new file mode 100644 index 000000000..b97d07e7b --- /dev/null +++ b/lighting_export_bmecat/security/lighting_bmecat_rule.xml @@ -0,0 +1,9 @@ + + + + Lighting BMEcat multi-company + + + [('company_id', 'in', [False] + company_ids)] + + diff --git a/lighting_export_bmecat/static/description/icon.png b/lighting_export_bmecat/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd641e792c30455187ca30940bc0f329ce8bbb0 GIT binary patch literal 6342 zcmd^^hf`C}*TzHWpfm-MZa|7OjYtjE(4`3pP0Eid3J8V{0s)mKJ<q zp^9|rp$mb~2}po9-@oIXJG(oxcjoS%d!O@s&d!Z9HP*e##KQyt0IurmK_64bp8pyH z9i^|ds>-JfbWVo4P{8GX*QeIfbjl2)kDfIG0ALvZuTgp2ZfK=U();NfY11z-vM>r= zo6RyI007+P`cO@apy}VqnaiVCLL`CEUGVGYE&5WpdhhbZv%|*-Y|2t(4~Cq|y`-Nmm-W zxaTf4+R69rVU1b%qjm?yu*PFgHFYd#J82-D8cpXqO&omwG2*Hd6ZIUiK@+ zNCo8Lg{1^vn^0ZQgz*~*ZR3wsULxnnSBN%7p()3EYs>sX9In)T{*nJ2q*qxXPNhFk z=z=+?4VOOdAF!ZYAVisYzF29g?udLQJtx@=HoAK_Kjx;4SO7>H_v*McB7(}RHMa> z+PN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pE{HN<@(9Hl11P5cHmN6A1F^sg2OWXcw<+q2x>I5 zq9Bu>PBob6#^vrr<|IC)m+zJpFRRcCVsqbspNybriu&!R=H^@RcG#aBGz9RH}ZI=>4 zi(m?IA?Vr$Q7?wN6ZW7H`S?3}K8=$7J5MjWKri=_igw1%J?0~*6e_Ii*1&23dGcF} z&=vaMgF!^veGQ1f$3k?WK5Jaw%==+Bb!tI6zQ68&-dQ3Orl+Tqh#Nt?dBEV_w^wkjY+qJ+X*NCMs%J-Lc4%}pKryM#O)O&9 un*HHVB-AlUN`suyDkKONktc!@Ievk;6wT20MOSqhE{1gM*SZGeqiYU literal 0 HcmV?d00001 diff --git a/lighting_export_bmecat/static/description/index.html b/lighting_export_bmecat/static/description/index.html new file mode 100644 index 000000000..39bba42a0 --- /dev/null +++ b/lighting_export_bmecat/static/description/index.html @@ -0,0 +1,418 @@ + + + + + +Lighting Export BMEcat + + + +
+

Lighting Export BMEcat

+ + +

Beta License: AGPL-3 NuoBiT/lighting-vertical

+

This module adds the function generate_generic_name for display names models

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions SL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the NuoBiT/lighting-vertical project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/lighting_export_bmecat/views/lighting_bmecat_views.xml b/lighting_export_bmecat/views/lighting_bmecat_views.xml new file mode 100644 index 000000000..c99f79088 --- /dev/null +++ b/lighting_export_bmecat/views/lighting_bmecat_views.xml @@ -0,0 +1,73 @@ + + + + + lighting.bmecat.form + lighting.bmecat + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + lighting.bmecat.tree + lighting.bmecat + + + + + + + + + + BMEcat + lighting.bmecat + tree,form + +

Create the first bmecat +

+
+
+ + +
diff --git a/lighting_export_bmecat/views/lighting_export_bmecat_views.xml b/lighting_export_bmecat/views/lighting_export_bmecat_views.xml new file mode 100644 index 000000000..98ea20044 --- /dev/null +++ b/lighting_export_bmecat/views/lighting_export_bmecat_views.xml @@ -0,0 +1,87 @@ + + + + + lighting.export.bmecat.form + lighting.export.bmecat + +
+
+ +
+ + + + + + + + + + + + + + + +
+
+
+ + + lighting.export.bmecat.tree + lighting.export.bmecat + + + + + + + + + + + + + + BMEcat + lighting.export.bmecat + tree,form + +

Create the first bmecat

+
+
+ + + + +
diff --git a/lighting_export_bmecat/views/product_catalog_views.xml b/lighting_export_bmecat/views/product_catalog_views.xml new file mode 100644 index 000000000..ea641ac57 --- /dev/null +++ b/lighting_export_bmecat/views/product_catalog_views.xml @@ -0,0 +1,19 @@ + + + + + catalog.form + lighting.catalog + + +
+
+
+
+
diff --git a/lighting_export_bmecat/views/report_bmecat.xml b/lighting_export_bmecat/views/report_bmecat.xml new file mode 100644 index 000000000..e26f264c3 --- /dev/null +++ b/lighting_export_bmecat/views/report_bmecat.xml @@ -0,0 +1,224 @@ + + + + lighting_export_bmecat.bmecat_report + BMEcat Export + qweb-xml + lighting.export.bmecat + + + + + + + + diff --git a/lighting_export_bmecat/wizard/__init__.py b/lighting_export_bmecat/wizard/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/lighting_export_bmecat/wizard/lighting_bmecat_wizard_views.xml b/lighting_export_bmecat/wizard/lighting_bmecat_wizard_views.xml new file mode 100644 index 000000000..198e61d68 --- /dev/null +++ b/lighting_export_bmecat/wizard/lighting_bmecat_wizard_views.xml @@ -0,0 +1,49 @@ + + + + + lighting.export.bmecat.wizard.form + lighting.export.bmecat + +
+
+ + + + + + + + + + +
+
+ + + + + Export BMEcat + lighting.export.bmecat + form + + {'default_catalog_id': active_id} + new + + diff --git a/setup/lighting_export_bmecat/odoo/addons/lighting_export_bmecat b/setup/lighting_export_bmecat/odoo/addons/lighting_export_bmecat new file mode 120000 index 000000000..260ab0eb1 --- /dev/null +++ b/setup/lighting_export_bmecat/odoo/addons/lighting_export_bmecat @@ -0,0 +1 @@ +../../../../lighting_export_bmecat \ No newline at end of file diff --git a/setup/lighting_export_bmecat/setup.py b/setup/lighting_export_bmecat/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/lighting_export_bmecat/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)