diff --git a/mrp_bom_responsible/README.rst b/mrp_bom_responsible/README.rst new file mode 100644 index 00000000000..cf5e61c8bb3 --- /dev/null +++ b/mrp_bom_responsible/README.rst @@ -0,0 +1,73 @@ +=================== +Mrp Bom Responsible +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/mrp_bom_responsible + :alt: OCA/manufacture +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_bom_responsible + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/129/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds a responsible to the Bill of Materials which then will be forwarded to the Manufacturing Order + +**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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ForgeFlow S.L. + +Contributors +~~~~~~~~~~~~ + +* Adria Gil Sorribes + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_bom_responsible/__init__.py b/mrp_bom_responsible/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/mrp_bom_responsible/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mrp_bom_responsible/__manifest__.py b/mrp_bom_responsible/__manifest__.py new file mode 100644 index 00000000000..25c549c1a78 --- /dev/null +++ b/mrp_bom_responsible/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Mrp Bom Responsible", + "summary": """ + Adds a responsible to the Bill of Materials which then will be + forwarded to the Manufacturing Order""", + "version": "12.0.1.0.0", + "license": "AGPL-3", + "author": "ForgeFlow S.L.," + "Odoo Community Association (OCA)", + "website": "https://www.github.com/OCA/manufacture", + "depends": [ + "mrp" + ], + "data": [ + "views/mrp_bom_views.xml", + ], +} diff --git a/mrp_bom_responsible/models/__init__.py b/mrp_bom_responsible/models/__init__.py new file mode 100644 index 00000000000..9a394f76367 --- /dev/null +++ b/mrp_bom_responsible/models/__init__.py @@ -0,0 +1,2 @@ +from . import mrp_bom +from . import mrp_production diff --git a/mrp_bom_responsible/models/mrp_bom.py b/mrp_bom_responsible/models/mrp_bom.py new file mode 100644 index 00000000000..9b9b2608f19 --- /dev/null +++ b/mrp_bom_responsible/models/mrp_bom.py @@ -0,0 +1,12 @@ +# Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MrpBom(models.Model): + _inherit = "mrp.bom" + + user_id = fields.Many2one( + "res.users", "Responsible", default=lambda self: self._uid + ) diff --git a/mrp_bom_responsible/models/mrp_production.py b/mrp_bom_responsible/models/mrp_production.py new file mode 100644 index 00000000000..eb71258fe69 --- /dev/null +++ b/mrp_bom_responsible/models/mrp_production.py @@ -0,0 +1,14 @@ +# Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + @api.onchange("bom_id") + def _onchange_bom_id(self): + super()._onchange_bom_id() + if self.bom_id and self.bom_id.user_id: + self.user_id = self.bom_id.user_id diff --git a/mrp_bom_responsible/readme/CONTRIBUTORS.rst b/mrp_bom_responsible/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..06b212d666d --- /dev/null +++ b/mrp_bom_responsible/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Adria Gil Sorribes diff --git a/mrp_bom_responsible/readme/DESCRIPTION.rst b/mrp_bom_responsible/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..c881322128c --- /dev/null +++ b/mrp_bom_responsible/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds a responsible to the Bill of Materials which then will be forwarded to the Manufacturing Order \ No newline at end of file diff --git a/mrp_bom_responsible/static/description/icon.png b/mrp_bom_responsible/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/mrp_bom_responsible/static/description/icon.png differ diff --git a/mrp_bom_responsible/static/description/index.html b/mrp_bom_responsible/static/description/index.html new file mode 100644 index 00000000000..07cb999f381 --- /dev/null +++ b/mrp_bom_responsible/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +Mrp Bom Responsible + + + +
+

Mrp Bom Responsible

+ + +

Beta License: AGPL-3 OCA/manufacture Translate me on Weblate Try me on Runbot

+

Adds a responsible to the Bill of Materials which then will be forwarded to the Manufacturing Order

+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Eficent Business and IT Consulting Services S.L.
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mrp_bom_responsible/views/mrp_bom_views.xml b/mrp_bom_responsible/views/mrp_bom_views.xml new file mode 100644 index 00000000000..c10d260fd57 --- /dev/null +++ b/mrp_bom_responsible/views/mrp_bom_views.xml @@ -0,0 +1,15 @@ + + + + + mrp.bom.form + mrp.bom + + + + + + + + + \ No newline at end of file