diff --git a/product_label_mrp/README.rst b/product_label_mrp/README.rst new file mode 100644 index 00000000..e69de29b diff --git a/product_label_mrp/__init__.py b/product_label_mrp/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/product_label_mrp/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_label_mrp/__manifest__.py b/product_label_mrp/__manifest__.py new file mode 100644 index 00000000..6ea1ee82 --- /dev/null +++ b/product_label_mrp/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) +# @author: Quentin DUPONT (quentin.dupont@grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Product Labels MRP", + "summary": "Adds labels in MRP BoMs", + "version": "16.0.1.0.0", + "category": "Product", + "author": "GRAP", + "maintainers": ["quentinDupont"], + "developpment_status": "Production/Stable", + "website": "https://github.com/grap/grap-odoo-business", + "license": "AGPL-3", + "depends": [ + "mrp", + "product", + # OCA + "product_label", + ], + "data": [ + "views/view_mrp_bom.xml", + ], + "installable": True, +} diff --git a/product_label_mrp/i18n/fr.po b/product_label_mrp/i18n/fr.po new file mode 100644 index 00000000..76c416ac --- /dev/null +++ b/product_label_mrp/i18n/fr.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_label_mrp +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-11 14:19+0000\n" +"PO-Revision-Date: 2024-07-11 14:19+0000\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: product_label_mrp +#: model:ir.model,name:product_label_mrp.model_mrp_bom +msgid "Bill of Material" +msgstr "Nomenclature" + +#. module: product_label_mrp +#: model:ir.model,name:product_label_mrp.model_mrp_bom_line +msgid "Bill of Material Line" +msgstr "Ligne de nomenclature" \ No newline at end of file diff --git a/product_label_mrp/models/__init__.py b/product_label_mrp/models/__init__.py new file mode 100644 index 00000000..6de1b836 --- /dev/null +++ b/product_label_mrp/models/__init__.py @@ -0,0 +1,2 @@ +from . import mrp_bom +from . import mrp_bom_line diff --git a/product_label_mrp/models/mrp_bom.py b/product_label_mrp/models/mrp_bom.py new file mode 100644 index 00000000..96ee168a --- /dev/null +++ b/product_label_mrp/models/mrp_bom.py @@ -0,0 +1,15 @@ +# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) +# @author: Quentin DUPONT (quentin.dupont@grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class MrpBom(models.Model): + _inherit = "mrp.bom" + + product_label_ids = fields.Many2many( + string="Product labels", + related="product_tmpl_id.label_ids", + readonly=False, + ) diff --git a/product_label_mrp/models/mrp_bom_line.py b/product_label_mrp/models/mrp_bom_line.py new file mode 100644 index 00000000..209ad4cc --- /dev/null +++ b/product_label_mrp/models/mrp_bom_line.py @@ -0,0 +1,15 @@ +# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) +# @author: Quentin DUPONT (quentin.dupont@grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class MrpBomLine(models.Model): + _inherit = "mrp.bom.line" + + product_label_ids = fields.Many2many( + comodel_name="product.label", + related="product_id.label_ids", + string="Labels on product", + ) diff --git a/product_label_mrp/readme/CONFIGURE.rst b/product_label_mrp/readme/CONFIGURE.rst new file mode 100644 index 00000000..42f0b97a --- /dev/null +++ b/product_label_mrp/readme/CONFIGURE.rst @@ -0,0 +1,10 @@ +* Go to "Setting > Technical > Parameters > Labels" + +.. figure:: ../static/description/product_label_kanban.png + +* Edit or create a Label + +.. figure:: ../static/description/product_label_form.png + +If "Display on Reports" is checked, label will be displayed on reports +by other glue modules, available in the same repository: ``product_label_account``, ``product_label_sale``, ... diff --git a/product_label_mrp/readme/CONTRIBUTORS.rst b/product_label_mrp/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..26cf8421 --- /dev/null +++ b/product_label_mrp/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Julien WESTE +* Sylvain LE GAL (https://www.twitter.com/legalsylvain) +* Quentin DUPONT diff --git a/product_label_mrp/readme/DESCRIPTION.rst b/product_label_mrp/readme/DESCRIPTION.rst new file mode 100644 index 00000000..9f670fab --- /dev/null +++ b/product_label_mrp/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module extends the functionality of Product module to support labels +on products. diff --git a/product_label_mrp/readme/USAGE.rst b/product_label_mrp/readme/USAGE.rst new file mode 100644 index 00000000..49781f79 --- /dev/null +++ b/product_label_mrp/readme/USAGE.rst @@ -0,0 +1,5 @@ +* Go to your product form + +.. figure:: ../static/description/product_template_form.png + +* Set one or many labels and save. diff --git a/product_label_mrp/static/description/DESCRIPTION.rst b/product_label_mrp/static/description/DESCRIPTION.rst new file mode 100644 index 00000000..b9e5b51f --- /dev/null +++ b/product_label_mrp/static/description/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds labels in BoMs : link BoM labels with Product labels, and permits to see labels on bom lines products. diff --git a/product_label_mrp/static/img/label_agriculture_biologique-image.png b/product_label_mrp/static/img/label_agriculture_biologique-image.png new file mode 100644 index 00000000..dca6dd82 Binary files /dev/null and b/product_label_mrp/static/img/label_agriculture_biologique-image.png differ diff --git a/product_label_mrp/static/img/label_gluten_free-image.png b/product_label_mrp/static/img/label_gluten_free-image.png new file mode 100644 index 00000000..f6309d2b Binary files /dev/null and b/product_label_mrp/static/img/label_gluten_free-image.png differ diff --git a/product_label_mrp/static/img/label_max_havelaar-image.png b/product_label_mrp/static/img/label_max_havelaar-image.png new file mode 100644 index 00000000..bc560abc Binary files /dev/null and b/product_label_mrp/static/img/label_max_havelaar-image.png differ diff --git a/product_label_mrp/views/view_mrp_bom.xml b/product_label_mrp/views/view_mrp_bom.xml new file mode 100644 index 00000000..7a47ef91 --- /dev/null +++ b/product_label_mrp/views/view_mrp_bom.xml @@ -0,0 +1,56 @@ + + + + + + + + + + mrp.bom + + + + + + + + + + + + + + + + + + + mrp.bom + + + + + + + + + + + + + + mrp.bom + + + + + + + + + diff --git a/setup/product_label_mrp/odoo/addons/product_label_mrp b/setup/product_label_mrp/odoo/addons/product_label_mrp new file mode 120000 index 00000000..8e3d755e --- /dev/null +++ b/setup/product_label_mrp/odoo/addons/product_label_mrp @@ -0,0 +1 @@ +../../../../product_label_mrp \ No newline at end of file diff --git a/setup/product_label_mrp/setup.py b/setup/product_label_mrp/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/product_label_mrp/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..38aef0bf --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ + + +git+https://github.com/grap/grap-odoo-business@refs/pull/159/head#subdirectory=setup/product_label