forked from OCA/manufacture
-
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.
Signed-off-by grindtildeath
- Loading branch information
Showing
18 changed files
with
854 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
============================ | ||
MRP Product Characterisation | ||
============================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:b585ec95c2b4eaec64e8d2412f583b1715e3ddc61c1572ebdf7933d6ea3d097f | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-OCA%2Fmanufacture-lightgray.png?logo=github | ||
:target: https://github.com/OCA/manufacture/tree/16.0/mrp_product_characterisation | ||
:alt: OCA/manufacture | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_product_characterisation | ||
: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/manufacture&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Adds characterisation "Intermediate Products" and adjust Components characterisation for Products. | ||
Adds BoM filter with theses characterisations. | ||
|
||
Intermediate products : contained in a BoM AND manufactured (has a BoM) | ||
Component products : contained in a BoM AND NOT manufactured (has no BoM) | ||
|
||
For example in bakeries, leavening is a intermediate product, and buckwheat flour | ||
a component product. | ||
|
||
.. figure:: https://raw.githubusercontent.com/OCA/manufacture/16.0/mrp_product_characterisation/static/description/intermediate_product.png | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_product_characterisation%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 | ||
~~~~~~~ | ||
|
||
* GRAP | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Quentin Dupont ([email protected]) | ||
|
||
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. | ||
|
||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/16.0/mrp_product_characterisation>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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 @@ | ||
from . import models |
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,22 @@ | ||
# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop) | ||
# @author: Quentin Dupont ([email protected]) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "MRP Product Characterisation", | ||
"summary": "Adds product characterisation 'Intermediate Products'.", | ||
"version": "16.0.1.0.0", | ||
"category": "Manufacturing", | ||
"author": "GRAP, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/manufacture", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"mrp", | ||
], | ||
"data": [ | ||
"views/view_mrp_bom.xml", | ||
"views/view_product_product.xml", | ||
"views/view_product_template.xml", | ||
], | ||
"installable": True, | ||
} |
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,82 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_product_characterisation | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-07-25 15:04+0000\n" | ||
"PO-Revision-Date: 2024-07-25 15:04+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: mrp_product_characterisation | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_bom_search | ||
msgid "BoM for finished product" | ||
msgstr "Fiche technique pour produit fini" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_bom_search | ||
msgid "BoM for intermediate product" | ||
msgstr "Fiche technique pour produit intermédiaire" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_product_product_search | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_product_template_search | ||
msgid "Components Products" | ||
msgstr "Matières premières" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_product_product_search | ||
#: model_terms:ir.ui.view,arch_db:mrp_product_characterisation.view_mrp_product_template_search | ||
msgid "Intermediates Products" | ||
msgstr "Produit intermédiaire" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model.fields,field_description:mrp_product_characterisation.field_product_product__is_component | ||
#: model:ir.model.fields,field_description:mrp_product_characterisation.field_product_template__is_component | ||
msgid "Is Component" | ||
msgstr "Est une matière première" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model.fields,field_description:mrp_product_characterisation.field_product_product__is_intermediate | ||
#: model:ir.model.fields,field_description:mrp_product_characterisation.field_product_template__is_intermediate | ||
msgid "Is Intermediate" | ||
msgstr "Est un produit intermédiaire" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model.fields,help:mrp_product_characterisation.field_product_product__is_component | ||
#: model:ir.model.fields,help:mrp_product_characterisation.field_product_template__is_component | ||
msgid "" | ||
"Is component a product which has no BoM based on it + is used " | ||
"in a BoM line" | ||
msgstr "" | ||
"Est une matière première tout produit qui n'a pas de Fiche technique basée " | ||
"sur elle + qui est utilisé dans une Fiche technique comme " | ||
"composant" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model.fields,help:mrp_product_characterisation.field_product_product__is_intermediate | ||
#: model:ir.model.fields,help:mrp_product_characterisation.field_product_template__is_intermediate | ||
msgid "" | ||
"Is intermediate a product which has a BoM based on it + is used" | ||
" in a BoM line" | ||
msgstr "" | ||
"Est un produit intermédiaire tout produit qui a une Fiche technique basée " | ||
"sur elle + qui est utilisé dans une Fiche technique comme " | ||
"composant" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model,name:mrp_product_characterisation.model_product_template | ||
msgid "Product" | ||
msgstr "Produit" | ||
|
||
#. module: mrp_product_characterisation | ||
#: model:ir.model,name:mrp_product_characterisation.model_product_product | ||
msgid "Product Variant" | ||
msgstr "Variante de produit" |
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,2 @@ | ||
from . import product_product | ||
from . import product_template |
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,33 @@ | ||
# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop) | ||
# @author: Quentin DUPONT ([email protected]) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
is_component = fields.Boolean( | ||
compute="_compute_is_component_intermediate", | ||
store=True, | ||
help="Is component a product which has no BoM based on it +\ | ||
is used in a BoM line", | ||
) | ||
is_intermediate = fields.Boolean( | ||
compute="_compute_is_component_intermediate", | ||
store=True, | ||
help="Is intermediate a product which has a BoM based on it +\ | ||
is used in a BoM line", | ||
) | ||
|
||
@api.depends("bom_line_ids", "variant_bom_ids") | ||
def _compute_is_component_intermediate(self): | ||
for product in self: | ||
if product.bom_line_ids: | ||
# Difference is having a BoM with this product or not | ||
product.is_intermediate = True if product.bom_count else False | ||
product.is_component = not product.is_intermediate | ||
else: | ||
product.is_intermediate = False | ||
product.is_component = False |
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,17 @@ | ||
# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop) | ||
# @author: Quentin DUPONT ([email protected]) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
is_component = fields.Boolean( | ||
related="product_variant_ids.is_component", | ||
) | ||
|
||
is_intermediate = fields.Boolean( | ||
related="product_variant_ids.is_intermediate", | ||
) |
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 @@ | ||
* Quentin Dupont ([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,10 @@ | ||
Adds characterisation "Intermediate Products" and adjust Components characterisation for Products. | ||
Adds BoM filter with theses characterisations. | ||
|
||
Intermediate products : contained in a BoM AND manufactured (has a BoM) | ||
Component products : contained in a BoM AND NOT manufactured (has no BoM) | ||
|
||
For example in bakeries, leavening is a intermediate product, and buckwheat flour | ||
a component product. | ||
|
||
.. figure:: ../static/description/intermediate_product.png |
Oops, something went wrong.