From 96b57bbff2a38c045d27bb7b036a8773c4cfcc31 Mon Sep 17 00:00:00 2001 From: Christopher Ormaza Date: Tue, 14 Dec 2021 14:34:34 -0500 Subject: [PATCH] [14.0][ADD] mrp_routing --- mrp_routing/README.rst | 107 ++++ mrp_routing/__init__.py | 4 + mrp_routing/__manifest__.py | 27 ++ mrp_routing/data/sequence_data.xml | 17 + mrp_routing/demo/routing_data.xml | 116 +++++ mrp_routing/i18n/mrp_routing.pot | 0 mrp_routing/models/__init__.py | 7 + mrp_routing/models/mrp_bom.py | 38 ++ mrp_routing/models/mrp_routing.py | 60 +++ mrp_routing/models/mrp_routing_workcenter.py | 35 ++ .../models/mrp_routing_workcenter_template.py | 132 +++++ mrp_routing/readme/CONTRIBUTORS.rst | 1 + mrp_routing/readme/DESCRIPTION.rst | 2 + mrp_routing/readme/USAGE.rst | 16 + mrp_routing/security/ir.model.access.csv | 5 + mrp_routing/static/description/icon.png | Bin 0 -> 9455 bytes mrp_routing/static/description/index.html | 455 ++++++++++++++++++ mrp_routing/tests/__init__.py | 1 + .../tests/test_manufacturing_routing.py | 295 ++++++++++++ mrp_routing/views/mrp_bom_view.xml | 18 + mrp_routing/views/mrp_routing_view.xml | 139 ++++++ .../mrp_routing_workcenter_template_view.xml | 143 ++++++ .../views/mrp_routing_workcenter_view.xml | 43 ++ setup/mrp_routing/odoo/addons/mrp_routing | 1 + setup/mrp_routing/setup.py | 6 + 25 files changed, 1668 insertions(+) create mode 100644 mrp_routing/README.rst create mode 100644 mrp_routing/__init__.py create mode 100644 mrp_routing/__manifest__.py create mode 100644 mrp_routing/data/sequence_data.xml create mode 100644 mrp_routing/demo/routing_data.xml create mode 100644 mrp_routing/i18n/mrp_routing.pot create mode 100644 mrp_routing/models/__init__.py create mode 100644 mrp_routing/models/mrp_bom.py create mode 100644 mrp_routing/models/mrp_routing.py create mode 100644 mrp_routing/models/mrp_routing_workcenter.py create mode 100644 mrp_routing/models/mrp_routing_workcenter_template.py create mode 100644 mrp_routing/readme/CONTRIBUTORS.rst create mode 100644 mrp_routing/readme/DESCRIPTION.rst create mode 100644 mrp_routing/readme/USAGE.rst create mode 100644 mrp_routing/security/ir.model.access.csv create mode 100644 mrp_routing/static/description/icon.png create mode 100644 mrp_routing/static/description/index.html create mode 100644 mrp_routing/tests/__init__.py create mode 100644 mrp_routing/tests/test_manufacturing_routing.py create mode 100644 mrp_routing/views/mrp_bom_view.xml create mode 100644 mrp_routing/views/mrp_routing_view.xml create mode 100644 mrp_routing/views/mrp_routing_workcenter_template_view.xml create mode 100644 mrp_routing/views/mrp_routing_workcenter_view.xml create mode 120000 setup/mrp_routing/odoo/addons/mrp_routing create mode 100644 setup/mrp_routing/setup.py diff --git a/mrp_routing/README.rst b/mrp_routing/README.rst new file mode 100644 index 000000000..82d8d2cb6 --- /dev/null +++ b/mrp_routing/README.rst @@ -0,0 +1,107 @@ +=========== +MRP Routing +=========== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github + :target: https://github.com/OCA/manufacture/tree/14.0/mrp_routing + :alt: OCA/manufacture +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_routing + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds routing concept as predefined operations, +operations should work as templates of operations on BOMs + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +You can add Routings on Manufacture / Products / Routings + +#. Create new Route +#. Add Operations + Operations its a copy of current operations on BOM, + with field "On template change?", this is Sync as default, + in this mode every change on this template is propagated + on operations related with this template + +Configure BOM and and Operations Page you can select predefined route (there are two ways to configure with templates) + - You can select a predefined route, + and this action replace and populate with templates associate + - Or You can add operations and select operation + as template to help setting default data + +On both configurations you can set field "On template change?" that change behavior when template related perform changes on data + +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 + +Contributors +~~~~~~~~~~~~ + +* Christopher Ormaza + +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. + +.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px + :target: https://github.com/ChrisOForgeFlow + :alt: ChrisOForgeFlow + +Current `maintainer `__: + +|maintainer-ChrisOForgeFlow| + +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_routing/__init__.py b/mrp_routing/__init__.py new file mode 100644 index 000000000..313fda46a --- /dev/null +++ b/mrp_routing/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2021 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/mrp_routing/__manifest__.py b/mrp_routing/__manifest__.py new file mode 100644 index 000000000..c32953388 --- /dev/null +++ b/mrp_routing/__manifest__.py @@ -0,0 +1,27 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "MRP Routing", + "version": "14.0.1.0.0", + "category": "Manufacturing", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/manufacture", + "license": "AGPL-3", + "maintainers": ["ChrisOForgeFlow"], + "development_status": "Alpha", + "depends": [ + "mrp", + ], + "data": [ + "data/sequence_data.xml", + "security/ir.model.access.csv", + "views/mrp_bom_view.xml", + "views/mrp_routing_view.xml", + "views/mrp_routing_workcenter_view.xml", + "views/mrp_routing_workcenter_template_view.xml", + ], + "demo": [ + "demo/routing_data.xml", + ], + "installable": True, +} diff --git a/mrp_routing/data/sequence_data.xml b/mrp_routing/data/sequence_data.xml new file mode 100644 index 000000000..e2492e088 --- /dev/null +++ b/mrp_routing/data/sequence_data.xml @@ -0,0 +1,17 @@ + + + + + + Routing + mrp.routing + RO/ + 5 + 1 + 1 + + + + + + diff --git a/mrp_routing/demo/routing_data.xml b/mrp_routing/demo/routing_data.xml new file mode 100644 index 000000000..f9020a568 --- /dev/null +++ b/mrp_routing/demo/routing_data.xml @@ -0,0 +1,116 @@ + + + + + + + Manual Assembly + 60 + 5 + pdf + + + + + + Long time assembly + 180 + 15 + pdf + + + + + + Testing + 60 + 10 + pdf + + + + + + Packing + 30 + 5 + pdf + + + + + + 120 + 5 + Manual Assembly + pdf + + + + + + 120 + 10 + Assembly Line 1 + pdf + + + + + Primary Assembly + + + + + Secondary Assembly + + + + + Manual Component's Assembly + + + + + Assemble Furniture + + + + + diff --git a/mrp_routing/i18n/mrp_routing.pot b/mrp_routing/i18n/mrp_routing.pot new file mode 100644 index 000000000..e69de29bb diff --git a/mrp_routing/models/__init__.py b/mrp_routing/models/__init__.py new file mode 100644 index 000000000..fa547adcd --- /dev/null +++ b/mrp_routing/models/__init__.py @@ -0,0 +1,7 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import mrp_routing_workcenter_template +from . import mrp_routing +from . import mrp_bom +from . import mrp_routing_workcenter diff --git a/mrp_routing/models/mrp_bom.py b/mrp_routing/models/mrp_bom.py new file mode 100644 index 000000000..adb45db24 --- /dev/null +++ b/mrp_routing/models/mrp_bom.py @@ -0,0 +1,38 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + +from .mrp_routing_workcenter_template import FIELDS_TO_SYNC + + +class MrpBom(models.Model): + + _inherit = "mrp.bom" + + routing_id = fields.Many2one( + comodel_name="mrp.routing", + string="Predefined Operations", + check_company=True, + tracking=True, + ) + + @api.onchange("routing_id") + def onchange_routing_id(self): + opeartion_model = self.env["mrp.routing.workcenter"] + if self.routing_id and self.routing_id.operation_ids: + new_operations = opeartion_model.browse() + for template_operation in self.routing_id.operation_ids: + operation_data = template_operation.read( + FIELDS_TO_SYNC, load="_classic_write" + )[0] + operation_data.pop("id") + if "operation_ids" in operation_data: + operation_data.pop("operation_ids") + operation_data.update( + { + "template_id": template_operation.id, + "on_template_change": "sync", + } + ) + new_operations |= opeartion_model.new(operation_data) + self.operation_ids = new_operations diff --git a/mrp_routing/models/mrp_routing.py b/mrp_routing/models/mrp_routing.py new file mode 100644 index 000000000..3209d2f09 --- /dev/null +++ b/mrp_routing/models/mrp_routing.py @@ -0,0 +1,60 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models + + +class MrpRouting(models.Model): + + _name = "mrp.routing" + _description = "Manufacturing Routing" + + name = fields.Char("Routing", required=True) + active = fields.Boolean( + "Active", + default=True, + help="If the active field is set to False, " + "it will allow you to hide the routing without removing it.", + ) + code = fields.Char( + "Reference", copy=False, default=lambda self: _("New"), readonly=True + ) + note = fields.Text("Description") + operation_ids = fields.Many2many( + comodel_name="mrp.routing.workcenter.template", string="Operations" + ) + company_id = fields.Many2one( + "res.company", "Company", default=lambda self: self.env.company + ) + bom_ids = fields.One2many( + comodel_name="mrp.bom", + inverse_name="routing_id", + string="Boms", + required=False, + copy=False, + ) + + @api.model + def create(self, vals): + if "code" not in vals or vals["code"] == _("New"): + vals["code"] = self.env["ir.sequence"].next_by_code("mrp.routing") or _( + "New" + ) + return super(MrpRouting, self).create(vals) + + def write(self, values): + res = super(MrpRouting, self).write(values) + if "operation_ids" in values: + for rec in self: + for bom in rec.bom_ids: + operations_not_synced = ( + rec.operation_ids - bom.operation_ids.mapped("template_id") + ) + for operation in operations_not_synced: + operation.create_operation_from_template(bom) + operations_to_delete = bom.operation_ids.filtered( + lambda x: x.template_id.id not in rec.operation_ids.ids + ) + if operations_to_delete: + operations_to_delete.unlink() + return res diff --git a/mrp_routing/models/mrp_routing_workcenter.py b/mrp_routing/models/mrp_routing_workcenter.py new file mode 100644 index 000000000..ec28e0381 --- /dev/null +++ b/mrp_routing/models/mrp_routing_workcenter.py @@ -0,0 +1,35 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + +from .mrp_routing_workcenter_template import FIELDS_TO_SYNC + + +class MrpRoutingWorkcenter(models.Model): + + _inherit = "mrp.routing.workcenter" + + template_id = fields.Many2one( + comodel_name="mrp.routing.workcenter.template", + string="Template", + readonly=False, + ) + + on_template_change = fields.Selection( + string="On template change?", + selection=[ + ("nothing", "Do nothing"), + ("sync", "Sync"), + ], + required=False, + default="sync", + ) + + @api.onchange("template_id") + def onchange_template_id(self): + if self.template_id: + to_update_data = self.template_id.read( + FIELDS_TO_SYNC, load="_classic_wirte" + )[0] + to_update_data.pop("id") + self.update(to_update_data) diff --git a/mrp_routing/models/mrp_routing_workcenter_template.py b/mrp_routing/models/mrp_routing_workcenter_template.py new file mode 100644 index 000000000..9a60a9829 --- /dev/null +++ b/mrp_routing/models/mrp_routing_workcenter_template.py @@ -0,0 +1,132 @@ +# Copyright 2023 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + +FIELDS_TO_SYNC = [ + "name", + "workcenter_id", + "sequence", + "worksheet_type", + "note", + "worksheet", + "worksheet_google_slide", + "time_mode", + "time_mode_batch", + "time_cycle_manual", + "on_template_change", +] + + +class MrpRoutingWorkcenterTemplate(models.Model): + + _name = "mrp.routing.workcenter.template" + _description = "Template Work Center Usage" + _order = "sequence, id" + _check_company_auto = True + + name = fields.Char("Operation", required=True) + workcenter_id = fields.Many2one( + "mrp.workcenter", "Work Center", required=True, check_company=True + ) + sequence = fields.Integer( + "Sequence", + default=100, + help="Gives the sequence order when displaying a list of routing Work Centers.", + ) + company_id = fields.Many2one( + "res.company", "Company", default=lambda self: self.env.company + ) + worksheet_type = fields.Selection( + [("pdf", "PDF"), ("google_slide", "Google Slide"), ("text", "Text")], + string="Work Sheet", + default="text", + help="Defines if you want to use a PDF " "or a Google Slide as work sheet.", + ) + note = fields.Text("Description", help="Text worksheet description") + worksheet = fields.Binary("PDF") + worksheet_google_slide = fields.Char( + "Google Slide", + help="Paste the url of your Google Slide. " + "Make sure the access to the document is public.", + ) + time_mode = fields.Selection( + [ + ("auto", "Compute based on tracked time"), + ("manual", "Set duration manually"), + ], + string="Duration Computation", + default="manual", + ) + time_mode_batch = fields.Integer("Based on", default=10) + time_cycle_manual = fields.Float( + "Manual Duration", + default=60, + help="Time in minutes:" + "- In manual mode, time used" + "- In automatic mode, " + "supposed first time when there aren't any work orders yet", + ) + operation_ids = fields.One2many( + comodel_name="mrp.routing.workcenter", + inverse_name="template_id", + string="Operations", + required=False, + copy=False, + ) + on_template_change = fields.Selection( + string="On template change?", + selection=[ + ("nothing", "Do nothing"), + ("sync", "Sync"), + ], + required=False, + default="sync", + ) + routing_ids = fields.Many2many(comodel_name="mrp.routing", string="Routings") + + def create_operation_from_template(self, bom): + operation_model = self.env["mrp.routing.workcenter"] + for operation in self: + operation_data = operation.read(FIELDS_TO_SYNC, load="_classic_write")[0] + operation_data.update( + { + "bom_id": bom.id, + "template_id": operation.id, + "on_template_change": "sync", + } + ) + operation_model.create(operation_data) + + @api.model_create_multi + def create(self, values): + recs = super(MrpRoutingWorkcenterTemplate, self).create(values) + for rec in self: + for bom in rec.mapped("routing_ids.bom_ids"): + rec.create_operation_from_template(bom) + return recs + + def unlink(self): + for rec in self: + synced_records = rec.operation_ids.filtered( + lambda x: x.on_template_change == "sync" + ) + if synced_records: + synced_records.unlink() + return super(MrpRoutingWorkcenterTemplate, self).unlink() + + def write(self, values): + res = super(MrpRoutingWorkcenterTemplate, self).write(values) + current_field_changes = [] + for field_name in FIELDS_TO_SYNC: + if field_name in values.keys(): + current_field_changes.append(field_name) + if current_field_changes: + for rec in self.filtered(lambda x: x.operation_ids): + to_write_data = rec.read(current_field_changes)[0] + to_write = rec.operation_ids.filtered( + lambda x: x.on_template_change == "sync" + ) + if to_write: + to_write.write(to_write_data) + return res diff --git a/mrp_routing/readme/CONTRIBUTORS.rst b/mrp_routing/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..b647a292e --- /dev/null +++ b/mrp_routing/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Christopher Ormaza diff --git a/mrp_routing/readme/DESCRIPTION.rst b/mrp_routing/readme/DESCRIPTION.rst new file mode 100644 index 000000000..5b30fe42f --- /dev/null +++ b/mrp_routing/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds routing concept as predefined operations, +operations should work as templates of operations on BOMs diff --git a/mrp_routing/readme/USAGE.rst b/mrp_routing/readme/USAGE.rst new file mode 100644 index 000000000..8f8aace0a --- /dev/null +++ b/mrp_routing/readme/USAGE.rst @@ -0,0 +1,16 @@ +You can add Routings on Manufacture / Products / Routings + +#. Create new Route +#. Add Operations + Operations its a copy of current operations on BOM, + with field "On template change?", this is Sync as default, + in this mode every change on this template is propagated + on operations related with this template + +Configure BOM and and Operations Page you can select predefined route (there are two ways to configure with templates) + - You can select a predefined route, + and this action replace and populate with templates associate + - Or You can add operations and select operation + as template to help setting default data + +On both configurations you can set field "On template change?" that change behavior when template related perform changes on data diff --git a/mrp_routing/security/ir.model.access.csv b/mrp_routing/security/ir.model.access.csv new file mode 100644 index 000000000..e02b54c14 --- /dev/null +++ b/mrp_routing/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0 +access_mrp_routing_manager,mrp.routing.manager,model_mrp_routing,mrp.group_mrp_manager,1,1,1,1 +access_mrp_routing_workcenter_template,mrp.routing.workcenter,model_mrp_routing_workcenter_template,mrp.group_mrp_user,1,0,0,0 +access_mrp_routing_workcenter_template_manager,mrp.routing.workcenter.manager,model_mrp_routing_workcenter_template,mrp.group_mrp_manager,1,1,1,1 diff --git a/mrp_routing/static/description/icon.png b/mrp_routing/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I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(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/mrp_routing/static/description/index.html b/mrp_routing/static/description/index.html new file mode 100644 index 000000000..d0e97590f --- /dev/null +++ b/mrp_routing/static/description/index.html @@ -0,0 +1,455 @@ + + + + + + +MRP Routing + + + +
+

MRP Routing

+ + +

Alpha License: LGPL-3 OCA/manufacture Translate me on Weblate Try me on Runbot

+

This module adds routing concept as predefined operations, +operations should work as templates of operations on BOMs

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Usage

+

You can add Routings on Manufacture / Products / Routings

+
    +
  1. Create new Route
  2. +
  3. +
    Add Operations
    +
    Operations its a copy of current operations on BOM, +with field “On template change?”, this is Sync as default, +in this mode every change on this template is propagated +on operations related with this template
    +
    +
  4. +
+
+
Configure BOM and and Operations Page you can select predefined route (there are two ways to configure with templates)
+
    +
  • You can select a predefined route, +and this action replace and populate with templates associate
  • +
  • Or You can add operations and select operation +as template to help setting default data
  • +
+
+
+

On both configurations you can set field “On template change?” that change behavior when template related perform changes on data

+
+
+

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
  • +
+
+
+

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.

+

Current maintainer:

+

ChrisOForgeFlow

+

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_routing/tests/__init__.py b/mrp_routing/tests/__init__.py new file mode 100644 index 000000000..f01dc2e11 --- /dev/null +++ b/mrp_routing/tests/__init__.py @@ -0,0 +1 @@ +from . import test_manufacturing_routing diff --git a/mrp_routing/tests/test_manufacturing_routing.py b/mrp_routing/tests/test_manufacturing_routing.py new file mode 100644 index 000000000..457fe0ea5 --- /dev/null +++ b/mrp_routing/tests/test_manufacturing_routing.py @@ -0,0 +1,295 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import SavepointCase + +from ..models.mrp_routing_workcenter_template import FIELDS_TO_SYNC + + +class TestRestrictLot(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product_obj = cls.env["product.product"] + cls.bom_obj = cls.env["mrp.bom"] + cls.bom_line_obj = cls.env["mrp.bom.line"] + cls.routing_obj = cls.env["mrp.routing"] + cls.workcenter_obj = cls.env["mrp.workcenter"] + cls.routing_workcenter_obj = cls.env["mrp.routing.workcenter"] + cls.routing_workcenter_template_obj = cls.env["mrp.routing.workcenter.template"] + + # Create products: + cls.product_1 = cls.product_obj.create({"name": "TEST 01", "type": "product"}) + cls.product_2 = cls.product_obj.create({"name": "TEST 02", "type": "product"}) + cls.product_3 = cls.product_obj.create({"name": "TEST 03", "type": "product"}) + cls.component_1 = cls.product_obj.create({"name": "RM 01", "type": "product"}) + cls.component_2 = cls.product_obj.create({"name": "RM 02", "type": "product"}) + # Create Bills of Materials: + cls.bom_1 = cls.bom_obj.create( + {"product_tmpl_id": cls.product_1.product_tmpl_id.id} + ) + cls.line_1_1 = cls.bom_line_obj.create( + { + "product_id": cls.component_1.id, + "bom_id": cls.bom_1.id, + "product_qty": 2.0, + } + ) + cls.line_1_2 = cls.bom_line_obj.create( + { + "product_id": cls.component_2.id, + "bom_id": cls.bom_1.id, + "product_qty": 5.0, + } + ) + cls.bom_2 = cls.bom_obj.create( + {"product_tmpl_id": cls.product_1.product_tmpl_id.id} + ) + cls.line_2_1 = cls.bom_line_obj.create( + { + "product_id": cls.component_1.id, + "bom_id": cls.bom_2.id, + "product_qty": 2.0, + } + ) + cls.line_2_2 = cls.bom_line_obj.create( + { + "product_id": cls.component_2.id, + "bom_id": cls.bom_2.id, + "product_qty": 5.0, + } + ) + cls.bom_3 = cls.bom_obj.create( + {"product_tmpl_id": cls.product_1.product_tmpl_id.id} + ) + cls.line_3_1 = cls.bom_line_obj.create( + { + "product_id": cls.component_1.id, + "bom_id": cls.bom_3.id, + "product_qty": 2.0, + } + ) + cls.line_3_2 = cls.bom_line_obj.create( + { + "product_id": cls.component_2.id, + "bom_id": cls.bom_3.id, + "product_qty": 5.0, + } + ) + # Create Routing + cls.workcenter_1 = cls.env.ref("mrp.mrp_workcenter_1") + cls.workcenter_2 = cls.env.ref("mrp.mrp_workcenter_2") + cls.workcenter_3 = cls.env.ref("mrp.mrp_workcenter_3") + cls.operation_template_1 = cls.routing_workcenter_template_obj.create( + { + "workcenter_id": cls.workcenter_1.id, + "name": "Operation 1", + "time_cycle_manual": 60, + "sequence": 5, + "worksheet_type": "text", + "on_template_change": "sync", + } + ) + cls.operation_template_2 = cls.routing_workcenter_template_obj.create( + { + "workcenter_id": cls.workcenter_2.id, + "name": "Operation 2", + "time_cycle_manual": 120, + "sequence": 10, + "worksheet_type": "text", + "on_template_change": "sync", + } + ) + cls.operation_template_3 = cls.routing_workcenter_template_obj.create( + { + "workcenter_id": cls.workcenter_3.id, + "name": "Operation 3", + "time_cycle_manual": 180, + "sequence": 15, + "worksheet_type": "text", + "on_template_change": "sync", + } + ) + cls.operation_template_4 = cls.routing_workcenter_template_obj.create( + { + "workcenter_id": cls.workcenter_2.id, + "name": "Operation 4", + "time_cycle_manual": 150, + "sequence": 15, + "worksheet_type": "text", + "on_template_change": "nothing", + } + ) + cls.routing_1 = cls.routing_obj.create( + { + "name": "Routing 1", + "operation_ids": [ + ( + 6, + 0, + [ + cls.operation_template_1.id, + cls.operation_template_2.id, + cls.operation_template_3.id, + cls.operation_template_4.id, + ], + ) + ], + } + ) + + def test_01_sync_onchange_predefined_operations(self): + self.bom_1.routing_id = self.routing_1.id + self.bom_1.onchange_routing_id() + self.assertEqual( + self.bom_1.operation_ids.mapped("template_id").ids, + self.routing_1.operation_ids.ids, + ) + for operation in self.bom_1.operation_ids: + for field_to_check in FIELDS_TO_SYNC: + # When is setted as predefined, + # all operations are in synced mode + if field_to_check == "on_template_change": + continue + self.assertEqual( + operation[field_to_check], operation.template_id[field_to_check] + ) + + def test_02_sync_templates_changes_by_bom(self): + self.bom_1.routing_id = self.routing_1.id + self.bom_1.onchange_routing_id() + self.bom_2.routing_id = self.routing_1.id + self.bom_2.onchange_routing_id() + self.operation_template_1.write( + { + "sequence": 30, + "time_cycle_manual": 100, + } + ) + for operation in self.routing_workcenter_obj.search( + [("template_id", "=", self.operation_template_1.id)] + ): + self.assertEqual(operation.sequence, self.operation_template_1.sequence) + self.assertEqual( + operation.time_cycle_manual, self.operation_template_1.time_cycle_manual + ) + # Operation 4 is setted that not sync on changes, + # but operations was created by predefined operations + self.operation_template_4.write( + { + "name": "New Operation Name", + "time_cycle_manual": 100, + } + ) + for operation in self.routing_workcenter_obj.search( + [("template_id", "=", self.operation_template_4.id)] + ): + self.assertEqual(operation.name, self.operation_template_4.name) + self.assertEqual( + operation.time_cycle_manual, self.operation_template_4.time_cycle_manual + ) + + # On delete all operations related should be deleted + self.assertEqual( + 2, + self.routing_workcenter_obj.search_count( + [("template_id", "=", self.operation_template_3.id)] + ), + ) + self.operation_template_3.unlink() + self.assertEqual( + 0, + self.routing_workcenter_obj.search_count( + [("template_id", "=", self.operation_template_3.id)] + ), + ) + + def test_03_sync_templates_changes_manual_creation(self): + operation_1 = self.routing_workcenter_obj.create( + { + "workcenter_id": self.workcenter_1.id, + "name": "Operation without name", + "time_cycle_manual": 150, + "sequence": 15, + "worksheet_type": "text", + "bom_id": self.bom_3.id, + } + ) + operation_1.write( + { + "template_id": self.operation_template_1, + } + ) + operation_1.onchange_template_id() + for field_to_check in FIELDS_TO_SYNC: + self.assertEqual( + operation_1[field_to_check], operation_1.template_id[field_to_check] + ) + operation_2 = self.routing_workcenter_obj.create( + { + "workcenter_id": self.workcenter_2.id, + "name": "Operation 4", + "time_cycle_manual": 20, + "sequence": 5, + "worksheet_type": "text", + "bom_id": self.bom_3.id, + } + ) + operation_2.write( + { + "template_id": self.operation_template_4, + } + ) + operation_2.onchange_template_id() + self.operation_template_4.write({"name": "New Name Operation 4"}) + self.assertNotEqual(operation_2.name, self.operation_template_4.name) + + def test_04_sync_templates_routing_changes(self): + self.bom_1.routing_id = self.routing_1.id + self.bom_1.onchange_routing_id() + self.bom_2.routing_id = self.routing_1.id + self.bom_2.onchange_routing_id() + self.routing_1.write( + { + "operation_ids": [ + ( + 6, + 0, + [ + self.operation_template_1.id, + self.operation_template_2.id, + ], + ) + ] + } + ) + self.assertNotIn( + self.operation_template_4.id, + self.bom_1.operation_ids.mapped("template_id").ids, + ) + self.assertNotIn( + self.operation_template_4.id, + self.bom_2.operation_ids.mapped("template_id").ids, + ) + self.routing_1.write( + { + "operation_ids": [ + ( + 6, + 0, + [ + self.operation_template_1.id, + self.operation_template_2.id, + self.operation_template_4.id, + ], + ) + ] + } + ) + self.assertIn( + self.operation_template_4.id, + self.bom_1.operation_ids.mapped("template_id").ids, + ) + self.assertIn( + self.operation_template_4.id, + self.bom_2.operation_ids.mapped("template_id").ids, + ) diff --git a/mrp_routing/views/mrp_bom_view.xml b/mrp_routing/views/mrp_bom_view.xml new file mode 100644 index 000000000..b57c8d636 --- /dev/null +++ b/mrp_routing/views/mrp_bom_view.xml @@ -0,0 +1,18 @@ + + + + + + mrp.bom.form.view + mrp.bom + + + + + + + + + diff --git a/mrp_routing/views/mrp_routing_view.xml b/mrp_routing/views/mrp_routing_view.xml new file mode 100644 index 000000000..ad754d6cb --- /dev/null +++ b/mrp_routing/views/mrp_routing_view.xml @@ -0,0 +1,139 @@ + + + + + + mrp.routing.form + mrp.routing + +
+ +
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + +
+
+
+
+ + + mrp.routing.tree + mrp.routing + + + + + + + + + + + + mrp.routing.kanban + mrp.routing + + + + + + +
+
+
+ +
+ +
+
+
+
+
+
+
+ + + mrp.routing.search + mrp.routing + + + + + + + + + + Routings + ir.actions.act_window + mrp.routing + tree,kanban,form + + + +

+ Create a new routing +

+ Routings define the successive operations that need to be + done to realize a Manufacturing Order. Each operation from + a Routing is done at a specific Work Center and has a specific duration. +

+
+
+ + + +
+
diff --git a/mrp_routing/views/mrp_routing_workcenter_template_view.xml b/mrp_routing/views/mrp_routing_workcenter_template_view.xml new file mode 100644 index 000000000..3b4888706 --- /dev/null +++ b/mrp_routing/views/mrp_routing_workcenter_template_view.xml @@ -0,0 +1,143 @@ + + + + + + mrp.routing.workcenter.template.tree + mrp.routing.workcenter.template + + + + + + + + + + + + mrp.routing.workcenter.template.form + mrp.routing.workcenter.template + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + mrp.routing.workcenter.template.search + mrp.routing.workcenter.template + + + + + + + + + + + + Template Operations + ir.actions.act_window + mrp.routing.workcenter.template + tree,form + + +

+ Create a new template operation +

+ Template Operation can be used to make template for operations related to bill of materials. +

+
+ [] +
+ + + + +
+
diff --git a/mrp_routing/views/mrp_routing_workcenter_view.xml b/mrp_routing/views/mrp_routing_workcenter_view.xml new file mode 100644 index 000000000..613454b9f --- /dev/null +++ b/mrp_routing/views/mrp_routing_workcenter_view.xml @@ -0,0 +1,43 @@ + + + + + + mrp.routing.workcenter.tree + mrp.routing.workcenter + + + + + + + + + + + + + + + + + + + + mrp.routing.workcenter.form + mrp.routing.workcenter + + + + + + + + + + + + diff --git a/setup/mrp_routing/odoo/addons/mrp_routing b/setup/mrp_routing/odoo/addons/mrp_routing new file mode 120000 index 000000000..a09be28a7 --- /dev/null +++ b/setup/mrp_routing/odoo/addons/mrp_routing @@ -0,0 +1 @@ +../../../../mrp_routing \ No newline at end of file diff --git a/setup/mrp_routing/setup.py b/setup/mrp_routing/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/mrp_routing/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)