Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions mrp_bom_warn_message_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
========================
MRP BOM Warn Message OCA
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:70349f6650da40e58f8fa9c9b1ab619553f9a7efe90770ec5ea07d34ab52c066
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.0/mrp_bom_warn_message_oca
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-18-0/manufacture-18-0-mrp_bom_warn_message_oca
: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=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to configure a warning on manufacturing orders when a
bill of materials is selected

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to MRP / Products / Bills of materials.

2. On the bill form, go to the Warning section and configure the warning
message

Usage
=====

To use this module, you need to:

1. Create a manufacturing order with a bill of materials that has a
configured warning
2. You will see a warning on the form header if the order is not done or
cancelled
3. If you manually create the order, you will also see a warning popup

Known issues / Roadmap
======================

- The module name has the \_oca suffix because somebody took the
mrp_bom_warn_message name in pypi

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_bom_warn_message_oca%0Aversion:%2018.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
-------

* Sygel Technology S.L.

Contributors
------------

- `Sygel <https://www.sygel.es>`__:

- Alberto Martínez
- Valentin Vinagre
- Harald Panten

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/18.0/mrp_bom_warn_message_oca>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions mrp_bom_warn_message_oca/__init__.py
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 models
24 changes: 24 additions & 0 deletions mrp_bom_warn_message_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "MRP BOM Warn Message OCA",
"summary": """
Add a configurable warning when a bill of materials
is selected on a MRP manufacturing order.
""",
"version": "18.0.1.0.0",
"category": "MRP",
"website": "https://github.com/OCA/manufacture",
"author": "Sygel Technology S.L., Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"mrp",
],
"data": [
"security/mrp_bom_warn_message_security.xml",
"views/mrp_bom_views.xml",
"views/mrp_production_views.xml",
],
}
88 changes: 88 additions & 0 deletions mrp_bom_warn_message_oca/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_bom_warn_message
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-20 10:49+0000\n"
"PO-Revision-Date: 2026-02-20 10:49+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_bom_warn_message
#: model:ir.model.fields,help:mrp_bom_warn_message.field_mrp_bom__production_warn
msgid ""
"\n"
" Selecting the \"Warning\" option will notify user with the message.\n"
" The Message has to be written in the next field.\n"
" "
msgstr ""
"\n"
" Selecionar la opcion \"Aviso\" notificará al ususario con el mensaje.\n"
" El mensaje tiene que ser escrito en el siguiente campo.\n"
" "

#. module: mrp_bom_warn_message
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_production_form_view_warn_inherit
msgid ""
"<i class=\"fa fa-info-circle\"/>\n"
" &amp;nbsp;"
msgstr ""

#. module: mrp_bom_warn_message
#: model:res.groups,name:mrp_bom_warn_message.group_warning_mrp_bom
msgid "A warning can be set on a MRP BOM (MRP)"
msgstr "Puede establecer avisos en listas de materiales (Fabricación)"

#. module: mrp_bom_warn_message
#: model:ir.model,name:mrp_bom_warn_message.model_mrp_bom
msgid "Bill of Material"
msgstr "Lista de materiales"

#. module: mrp_bom_warn_message
#: model:ir.model,name:mrp_bom_warn_message.model_mrp_production
msgid "Manufacturing Order"
msgstr "Orden de fabricación"

#. module: mrp_bom_warn_message
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_bom__production_warn_msg
msgid "Message for Production Warn"
msgstr "Mensaje del aviso en orden de producción"

#. module: mrp_bom_warn_message
#: model:ir.model.fields.selection,name:mrp_bom_warn_message.selection__mrp_bom__production_warn__no-message
msgid "No Message"
msgstr "Sin mensaje"

#. module: mrp_bom_warn_message
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_production__production_warn_msg
msgid "Production Warning Message"
msgstr "Mensaje del aviso en orden de producción"

#. module: mrp_bom_warn_message
#: model:ir.model.fields,field_description:mrp_bom_warn_message.field_mrp_bom__production_warn
msgid "Production Warnings"
msgstr "Aviso en orden de producción"

#. module: mrp_bom_warn_message
#: model:ir.model.fields.selection,name:mrp_bom_warn_message.selection__mrp_bom__production_warn__warning
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_bom_form_view_warn_inherit
msgid "Warning"
msgstr "Aviso"

#. module: mrp_bom_warn_message
#. odoo-python
#: code:addons/mrp_bom_warn_message/models/mrp_production.py:0
msgid "Warning of MRP BOM"
msgstr "Aviso de la lista de materiales"

#. module: mrp_bom_warn_message
#: model_terms:ir.ui.view,arch_db:mrp_bom_warn_message.mrp_bom_form_view_warn_inherit
msgid "Write your warn message..."
msgstr "Escriba su mensaje de aviso..."
4 changes: 4 additions & 0 deletions mrp_bom_warn_message_oca/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import mrp_bom
from . import mrp_production
20 changes: 20 additions & 0 deletions mrp_bom_warn_message_oca/models/mrp_bom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class MrpBom(models.Model):
_inherit = "mrp.bom"

production_warn = fields.Selection(
selection=[("no-message", "No Message"), ("warning", "Warning")],
string="Production Warnings",
default="no-message",
required=True,
help="""
Selecting the "Warning" option will notify user with the message.
The Message has to be written in the next field.
""",
)
production_warn_msg = fields.Text(string="Message for Production Warn")
35 changes: 35 additions & 0 deletions mrp_bom_warn_message_oca/models/mrp_production.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models


class MrpProduction(models.Model):
_inherit = "mrp.production"

production_warn_msg = fields.Text(
string="Production Warning Message", compute="_compute_production_warn_msg"
)

@api.depends("bom_id.production_warn")
def _compute_production_warn_msg(self):
for rec in self:
production_warn_msg = False
if (
rec.state not in ["done", "cancel"]
and rec.bom_id
and rec.bom_id.production_warn == "warning"
):
production_warn_msg = rec.bom_id.production_warn_msg
rec.production_warn_msg = production_warn_msg

@api.onchange("bom_id")
def _onchange_bom_id_warning(self):
self.ensure_one()
if self.production_warn_msg:
return {
"warning": {
"title": _("Warning of MRP BOM"),
"message": self.bom_id.production_warn_msg,
}
}
3 changes: 3 additions & 0 deletions mrp_bom_warn_message_oca/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions mrp_bom_warn_message_oca/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To configure this module, you need to:

1. Go to MRP / Products / Bills of materials.

2. On the bill form, go to the Warning section and configure the warning message
4 changes: 4 additions & 0 deletions mrp_bom_warn_message_oca/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Sygel](https://www.sygel.es):
- Alberto Martínez
- Valentin Vinagre
- Harald Panten
1 change: 1 addition & 0 deletions mrp_bom_warn_message_oca/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to configure a warning on manufacturing orders when a bill of materials is selected
1 change: 1 addition & 0 deletions mrp_bom_warn_message_oca/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The module name has the _oca suffix because somebody took the mrp_bom_warn_message name in pypi
5 changes: 5 additions & 0 deletions mrp_bom_warn_message_oca/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

1. Create a manufacturing order with a bill of materials that has a configured warning
2. You will see a warning on the form header if the order is not done or cancelled
3. If you manually create the order, you will also see a warning popup
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2026 Alberto Martínez <alberto.martinez@sygel.es>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="group_warning_mrp_bom" model="res.groups">
<field name="name">A warning can be set on a MRP BOM (MRP)</field>
<field name="category_id" ref="base.module_category_hidden" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading