Skip to content

Commit 4752b2d

Browse files
committed
[ADD] mrp_bom_warn_message
1 parent a126b9f commit 4752b2d

20 files changed

+990
-0
lines changed

mrp_bom_warn_message/README.rst

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
====================
2+
MRP BOM Warn Message
3+
====================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:70349f6650da40e58f8fa9c9b1ab619553f9a7efe90770ec5ea07d34ab52c066
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
20+
:target: https://github.com/OCA/manufacture/tree/18.0/mrp_bom_warn_message
21+
:alt: OCA/manufacture
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/manufacture-18-0/manufacture-18-0-mrp_bom_warn_message
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows to configure a warning on manufacturing orders when a
32+
bill of materials is selected
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Configuration
40+
=============
41+
42+
To configure this module, you need to:
43+
44+
1. Go to MRP / Products / Bills of materials.
45+
46+
2. On the bill form, go to the Warning section and configure the warning
47+
message
48+
49+
Usage
50+
=====
51+
52+
To use this module, you need to:
53+
54+
1. Create a manufacturing order with a bill of materials that has a
55+
configured warning
56+
2. You will see a warning on the form header if the order is not done or
57+
cancelled
58+
3. If you manually create the order, you will also see a warning popup
59+
60+
Bug Tracker
61+
===========
62+
63+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
64+
In case of trouble, please check there if your issue has already been reported.
65+
If you spotted it first, help us to smash it by providing a detailed and welcomed
66+
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_bom_warn_message%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
67+
68+
Do not contact contributors directly about support or help with technical issues.
69+
70+
Credits
71+
=======
72+
73+
Authors
74+
-------
75+
76+
* Sygel Technology S.L.
77+
78+
Contributors
79+
------------
80+
81+
- `Sygel <https://www.sygel.es>`__:
82+
83+
- Alberto Martínez
84+
- Valentin Vinagre
85+
- Harald Panten
86+
87+
Maintainers
88+
-----------
89+
90+
This module is maintained by the OCA.
91+
92+
.. image:: https://odoo-community.org/logo.png
93+
:alt: Odoo Community Association
94+
:target: https://odoo-community.org
95+
96+
OCA, or the Odoo Community Association, is a nonprofit organization whose
97+
mission is to support the collaborative development of Odoo features and
98+
promote its widespread use.
99+
100+
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/18.0/mrp_bom_warn_message>`_ project on GitHub.
101+
102+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

mrp_bom_warn_message/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "MRP BOM Warn Message",
5+
"summary": """
6+
Add a configurable warning when a bill of materials
7+
is selected on a MRP manufacturing order.
8+
""",
9+
"version": "18.0.1.0.0",
10+
"category": "MRP",
11+
"website": "https://github.com/OCA/manufacture",
12+
"author": "Sygel Technology S.L., Odoo Community Association (OCA)",
13+
"license": "AGPL-3",
14+
"application": False,
15+
"installable": True,
16+
"depends": [
17+
"mrp",
18+
],
19+
"data": [
20+
"security/mrp_bom_warn_message_security.xml",
21+
"views/mrp_bom_views.xml",
22+
"views/mrp_production_views.xml",
23+
],
24+
}

mrp_bom_warn_message/i18n/es.po

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * mrp_bom_warn_message
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2026-02-20 10:49+0000\n"
10+
"PO-Revision-Date: 2026-02-20 10:49+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: mrp_bom_warn_message
19+
#: model:ir.model.fields,help:mrp_bom_warn_message.field_mrp_bom__production_warn
20+
msgid ""
21+
"\n"
22+
" Selecting the \"Warning\" option will notify user with the message.\n"
23+
" The Message has to be written in the next field.\n"
24+
" "
25+
msgstr ""
26+
"\n"
27+
" Selecionar la opcion \"Aviso\" notificará al ususario con el mensaje.\n"
28+
" El mensaje tiene que ser escrito en el siguiente campo.\n"
29+
" "
30+
31+
#. module: mrp_bom_warn_message
32+
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_production_form_view_warn_inherit
33+
msgid ""
34+
"<i class=\"fa fa-info-circle\"/>\n"
35+
" &amp;nbsp;"
36+
msgstr ""
37+
38+
#. module: mrp_bom_warn_message
39+
#: model:res.groups,name:mrp_bom_warn_message.group_warning_mrp_bom
40+
msgid "A warning can be set on a MRP BOM (MRP)"
41+
msgstr "Puede establecer avisos en listas de materiales (Fabricación)"
42+
43+
#. module: mrp_bom_warn_message
44+
#: model:ir.model,name:mrp_bom_warn_message.model_mrp_bom
45+
msgid "Bill of Material"
46+
msgstr "Lista de materiales"
47+
48+
#. module: mrp_bom_warn_message
49+
#: model:ir.model,name:mrp_bom_warn_message.model_mrp_production
50+
msgid "Manufacturing Order"
51+
msgstr "Orden de fabricación"
52+
53+
#. module: mrp_bom_warn_message
54+
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_bom__production_warn_msg
55+
msgid "Message for Production Warn"
56+
msgstr "Mensaje del aviso en orden de producción"
57+
58+
#. module: mrp_bom_warn_message
59+
#: model:ir.model.fields.selection,name:mrp_bom_warn_message.selection__mrp_bom__production_warn__no-message
60+
msgid "No Message"
61+
msgstr "Sin mensaje"
62+
63+
#. module: mrp_bom_warn_message
64+
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_production__production_warn_msg
65+
msgid "Production Warning Message"
66+
msgstr "Mensaje del aviso en orden de producción"
67+
68+
#. module: mrp_bom_warn_message
69+
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_bom__production_warn
70+
msgid "Production Warnings"
71+
msgstr "Aviso en orden de producción"
72+
73+
#. module: mrp_bom_warn_message
74+
#: model:ir.model.fields.selection,name:mrp_bom_warn_message.selection__mrp_bom__production_warn__warning
75+
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_bom_form_view_warn_inherit
76+
msgid "Warning"
77+
msgstr "Aviso"
78+
79+
#. module: mrp_bom_warn_message
80+
#. odoo-python
81+
#: code:addons/mrp_bom_warn_message/models/mrp_production.py:0
82+
msgid "Warning of MRP BOM"
83+
msgstr "Aviso de la lista de materiales"
84+
85+
#. module: mrp_bom_warn_message
86+
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_bom_form_view_warn_inherit
87+
msgid "Write your warn message..."
88+
msgstr "Escriba su mensaje de aviso..."
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import mrp_bom
4+
from . import mrp_production
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class MrpBom(models.Model):
8+
_inherit = "mrp.bom"
9+
10+
production_warn = fields.Selection(
11+
selection=[("no-message", "No Message"), ("warning", "Warning")],
12+
string="Production Warnings",
13+
default="no-message",
14+
required=True,
15+
help="""
16+
Selecting the "Warning" option will notify user with the message.
17+
The Message has to be written in the next field.
18+
""",
19+
)
20+
production_warn_msg = fields.Text(string="Message for Production Warn")
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import _, api, fields, models
5+
6+
7+
class MrpProduction(models.Model):
8+
_inherit = "mrp.production"
9+
10+
production_warn_msg = fields.Text(
11+
string="Production Warning Message", compute="_compute_production_warn_msg"
12+
)
13+
14+
@api.depends("bom_id.production_warn")
15+
def _compute_production_warn_msg(self):
16+
for rec in self:
17+
production_warn_msg = False
18+
if (
19+
rec.state not in ["done", "cancel"]
20+
and rec.bom_id
21+
and rec.bom_id.production_warn == "warning"
22+
):
23+
production_warn_msg = rec.bom_id.production_warn_msg
24+
rec.production_warn_msg = production_warn_msg
25+
26+
@api.onchange("bom_id")
27+
def _onchange_bom_id_warning(self):
28+
self.ensure_one()
29+
if self.production_warn_msg:
30+
return {
31+
"warning": {
32+
"title": _("Warning of MRP BOM"),
33+
"message": self.bom_id.production_warn_msg,
34+
}
35+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To configure this module, you need to:
2+
3+
1. Go to MRP / Products / Bills of materials.
4+
5+
2. On the bill form, go to the Warning section and configure the warning message
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Sygel](https://www.sygel.es):
2+
- Alberto Martínez
3+
- Valentin Vinagre
4+
- Harald Panten

0 commit comments

Comments
 (0)