diff --git a/odoo_merge_mrp_orders/README.rst b/odoo_merge_mrp_orders/README.rst new file mode 100755 index 000000000..010aece27 --- /dev/null +++ b/odoo_merge_mrp_orders/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Merge Manufacturing Orders +========================== +* This module allow us to merge manufacturing order. + +Installation +============ +- www.odoo.com/documentation/15.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + + +Credits +------- +Developer: (v14) Sahla Sherin , Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/odoo_merge_mrp_orders/__init__.py b/odoo_merge_mrp_orders/__init__.py new file mode 100644 index 000000000..d4b63604d --- /dev/null +++ b/odoo_merge_mrp_orders/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import wizard diff --git a/odoo_merge_mrp_orders/__manifest__.py b/odoo_merge_mrp_orders/__manifest__.py new file mode 100644 index 000000000..82903aeb2 --- /dev/null +++ b/odoo_merge_mrp_orders/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Merge Manufacturing Orders", + 'version': '14.0.1.0.0', + 'category': 'Manufacturing', + 'summary': """The Manufacturing Order Merge module in Odoo allows users to + combine multiple manufacturing orders into a single order.""", + 'description': """Combine multiple manufacturing orders into a single order + with the Manufacturing Order Merge module in Odoo. Effortlessly manage + various types of merging, control merge quantities, and access merged + order information in the chatter.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'mrp', 'stock'], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_config_settings_views.xml', + 'wizard/order_mrp_merge_views.xml', + 'data/odoo_merge_mrp_orders_data.xml' + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/odoo_merge_mrp_orders/data/odoo_merge_mrp_orders_data.xml b/odoo_merge_mrp_orders/data/odoo_merge_mrp_orders_data.xml new file mode 100644 index 000000000..bc6efcd0a --- /dev/null +++ b/odoo_merge_mrp_orders/data/odoo_merge_mrp_orders_data.xml @@ -0,0 +1,16 @@ + + + + + Merge Order + ir.actions.server + + + list + code + + if len(records)>1: + action = records.action_merge_order() + + + diff --git a/odoo_merge_mrp_orders/doc/RELEASE_NOTES.md b/odoo_merge_mrp_orders/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9bfb407a4 --- /dev/null +++ b/odoo_merge_mrp_orders/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 28.03.2024 +#### Version 14.0.1.0.0 +#### ADD +- Initial commit for Merge Manufacturing Orders. diff --git a/odoo_merge_mrp_orders/models/__init__.py b/odoo_merge_mrp_orders/models/__init__.py new file mode 100644 index 000000000..4c6952c4f --- /dev/null +++ b/odoo_merge_mrp_orders/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Roopchand P M() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import mrp_production +from . import res_config_settings diff --git a/odoo_merge_mrp_orders/models/mrp_production.py b/odoo_merge_mrp_orders/models/mrp_production.py new file mode 100644 index 000000000..23f9eed1c --- /dev/null +++ b/odoo_merge_mrp_orders/models/mrp_production.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Roopchand P M() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, _ +from odoo.exceptions import UserError + + +class MrpProduction(models.Model): + """ + This class extends the 'mrp.production' model to add a method for merging + multiple manufacturing orders into a single order. + """ + _inherit = 'mrp.production' + + def action_merge_order(self): + """Merge multiple manufacturing orders into a single order. + + Check orders' state, product, BOM, and company consistency. + return: An action opening the order.mrp.merge wizard. + Raise UserError for invalid orders. + """ + product = [] + bom = [] + company = [] + for rec in self: + if rec.state not in ('draft', 'confirmed', 'progress'): + raise UserError( + _("You can only merge mrp order that " + "are in Draft/Confirmed/Progress state")) + product.append(rec.product_id) + bom.append(rec.bom_id) + company.append(rec.company_id.id) + if len(set(product)) != 1 and len(set(bom)) != 1: + raise UserError( + _("You can only merge mrp order that have same product and " + "bill of material")) + if len(set(company)) != 1: + raise UserError( + _("You can only merge mrp order in the same company")) + return { + 'name': "Merge Manufacturing order", + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'order.mrp.merge', + 'context': {'records': [rec.id for rec in self], + 'default_product_id': product[0].id, + 'default_bom_id': bom[0].id, + 'default_component_location_id': self[ + 0].location_src_id.id, + 'default_component_destination_location_id': self[ + 0].location_dest_id.id, + 'default_manage_qty': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'odoo_merge_mrp_orders.merge_qty')}, + 'target': 'new' + } diff --git a/odoo_merge_mrp_orders/models/res_config_settings.py b/odoo_merge_mrp_orders/models/res_config_settings.py new file mode 100644 index 000000000..58b2750d2 --- /dev/null +++ b/odoo_merge_mrp_orders/models/res_config_settings.py @@ -0,0 +1,52 @@ +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Roopchand P M() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """ Inherit the settings to add options to enable additional features + for merging manufacturing order.""" + _inherit = 'res.config.settings' + + merge_mrp_type = fields.Selection( + string="Merge Type", + selection=[ + ('order_none', "New order and Do nothing with selected mrp orders"), + ('order_cancel', "New order and Cancel selected mrp orders"), + ('order_remove', "New order and Remove selected mrp orders"), + ('merge_none', + "Existing order and Do nothing with selected mrp orders"), + ('merge_cancel', "Existing order and Cancel selected mrp orders"), + ('merge_remove', "Existing order and Remove selected mrp orders") + ], + default='order_none', + config_parameter='odoo_merge_mrp_orders.merge_mrp_type', + help="Select the type of merge operation for manufacturing orders." + ) + merge_order_notify = fields.Boolean( + string='Notify in chatter', + config_parameter='odoo_merge_mrp_orders.merge_order_notify', + help="Enable notification in the chatter for merged manufacturing " + "orders.") + merge_qty = fields.Boolean( + string="Manage merge quantity", + config_parameter='odoo_merge_mrp_orders.merge_qty', + help="Enable managing merge quantity for merged manufacturing orders.") diff --git a/odoo_merge_mrp_orders/security/ir.model.access.csv b/odoo_merge_mrp_orders/security/ir.model.access.csv new file mode 100644 index 000000000..04c82246b --- /dev/null +++ b/odoo_merge_mrp_orders/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_order_mrp_merge,access.order.mrp.merge,model_order_mrp_merge,base.group_user,1,1,1,1 +access_mrp_merge_line,access.mrp.merge.line,model_mrp_merge_line,base.group_user,1,1,1,1 diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/check.png b/odoo_merge_mrp_orders/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/check.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/chevron.png b/odoo_merge_mrp_orders/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/chevron.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/cogs.png b/odoo_merge_mrp_orders/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/cogs.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/consultation.png b/odoo_merge_mrp_orders/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/consultation.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/ecom-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/education-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/education-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/hotel-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/license.png b/odoo_merge_mrp_orders/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/license.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/lifebuoy.png b/odoo_merge_mrp_orders/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/manufacturing-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/pos-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/pos-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/puzzle.png b/odoo_merge_mrp_orders/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/puzzle.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/restaurant-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/service-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/service-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/trading-black.png b/odoo_merge_mrp_orders/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/trading-black.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/training.png b/odoo_merge_mrp_orders/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/training.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/update.png b/odoo_merge_mrp_orders/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/update.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/user.png b/odoo_merge_mrp_orders/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/user.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/icons/wrench.png b/odoo_merge_mrp_orders/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/icons/wrench.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/categories.png b/odoo_merge_mrp_orders/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/categories.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/check-box.png b/odoo_merge_mrp_orders/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/check-box.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/compass.png b/odoo_merge_mrp_orders/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/compass.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/corporate.png b/odoo_merge_mrp_orders/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/corporate.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/customer-support.png b/odoo_merge_mrp_orders/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/customer-support.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/cybrosys-logo.png b/odoo_merge_mrp_orders/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/cybrosys-logo.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/features.png b/odoo_merge_mrp_orders/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/features.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/logo.png b/odoo_merge_mrp_orders/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/logo.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/pictures.png b/odoo_merge_mrp_orders/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/pictures.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/pie-chart.png b/odoo_merge_mrp_orders/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/pie-chart.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/right-arrow.png b/odoo_merge_mrp_orders/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/right-arrow.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/star.png b/odoo_merge_mrp_orders/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/star.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/support.png b/odoo_merge_mrp_orders/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/support.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/misc/whatsapp.png b/odoo_merge_mrp_orders/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/misc/whatsapp.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/1.png b/odoo_merge_mrp_orders/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/1.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/2.png b/odoo_merge_mrp_orders/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/2.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/3.png b/odoo_merge_mrp_orders/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/3.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/4.png b/odoo_merge_mrp_orders/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/4.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/5.gif b/odoo_merge_mrp_orders/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/5.gif differ diff --git a/odoo_merge_mrp_orders/static/description/assets/modules/6.png b/odoo_merge_mrp_orders/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/modules/6.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/1.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..b55ea5e65 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/1.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/10.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..2edc78bae Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/10.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/2.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..44a4f8687 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/2.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/3.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..8fa83f0a6 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/3.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/4.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..94857e936 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/4.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/5.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..840d73d04 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/5.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/6.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..2696f849d Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/6.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/7.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..edaf62f24 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/7.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/8.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..72181d77a Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/8.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/9.png b/odoo_merge_mrp_orders/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..921cfbd56 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/9.png differ diff --git a/odoo_merge_mrp_orders/static/description/assets/screenshots/hero.gif b/odoo_merge_mrp_orders/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d69df5af0 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_merge_mrp_orders/static/description/banner.png b/odoo_merge_mrp_orders/static/description/banner.png new file mode 100644 index 000000000..f35b2cc99 Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/banner.png differ diff --git a/odoo_merge_mrp_orders/static/description/icon.png b/odoo_merge_mrp_orders/static/description/icon.png new file mode 100644 index 000000000..bf491b7cc Binary files /dev/null and b/odoo_merge_mrp_orders/static/description/icon.png differ diff --git a/odoo_merge_mrp_orders/static/description/index.html b/odoo_merge_mrp_orders/static/description/index.html new file mode 100644 index 000000000..3ba1b13c8 --- /dev/null +++ b/odoo_merge_mrp_orders/static/description/index.html @@ -0,0 +1,596 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Merge Manufacturing Orders

+

We can merge + manufacturing order

+ + +
+
+
+
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module allows you to combine two or more manufacturing orders into a single manufacturing order. + The merge process involves selecting the manufacturing orders you want to merge and then selecting the merge + option. + Overall, merge manufacturing order in Odoo can help streamline your production process and improve your + manufacturing efficiency. +
+ +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Help us combine several manufacturing orders into a single order. +
+
+ + There exist various types of merging. +
+
+ + You can manage merge quantity. +
+
+ + Notify in chatter. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Merge Order + option

+

Select the orders you want to merge, then navigate to the Action menu where you'll find the 'Merge Order' option.

+ +
+ +
+

Products and Bill of + materials +

+

We can only merge manufacturing orders that have the same product and bill of materials.

+ + +
+ +
+

Order's State

+

The state of the manufacturing order must be draft, confirmed, or in progress.

+ +
+ +
+

Merge Types

+

These are different + types of merge.

+ +
+ +
+

Merge window

+

After selecting orders, + a new wizard will pop up and where we can select our merge type, component location, and finished + location.

+ +
+
+

Merge type new + order

+

After selecting orders and merging them with the merge type 'New order and Do nothing with selected mrp orders' we obtain the following result.

+ +
+
+

Merge type existing + orders

+

In the case of existing + orders merge type, we can select the manufacturing order we want to merge.

+ +
+
+

Additional options

+

Default merge type, Manage merge quantity and notify in the chatter is an additional options available.

+ +
+
+

Manage merge quantity

+

Quantity can be changed from a given field, It should be less than that total product quantity in orders.

+ +
+
+

Notify in chatter

+

Here we can see the details of manufacturing orders that related to current order.

+ +
+
+
+ + + +
+
+ +
+

Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/odoo_merge_mrp_orders/views/res_config_settings_views.xml b/odoo_merge_mrp_orders/views/res_config_settings_views.xml new file mode 100644 index 000000000..523863350 --- /dev/null +++ b/odoo_merge_mrp_orders/views/res_config_settings_views.xml @@ -0,0 +1,66 @@ + + + + + res.config.settings.view.form.inherit.odoo.merge.mrp.orders + + res.config.settings + + + + + + + +

Manufacturing Order Merge Configuration

+ +
+ +
+
+ Default Merge Type +
+ Choose default merge type +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
diff --git a/odoo_merge_mrp_orders/wizard/__init__.py b/odoo_merge_mrp_orders/wizard/__init__.py new file mode 100644 index 000000000..fc93e10e9 --- /dev/null +++ b/odoo_merge_mrp_orders/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Roopchand P M() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import order_mrp_merge diff --git a/odoo_merge_mrp_orders/wizard/order_mrp_merge.py b/odoo_merge_mrp_orders/wizard/order_mrp_merge.py new file mode 100644 index 000000000..603651143 --- /dev/null +++ b/odoo_merge_mrp_orders/wizard/order_mrp_merge.py @@ -0,0 +1,298 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Roopchand P M() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models, _ + + +class OrderMrpMerge(models.TransientModel): + """ + Wizard that allow us to merge mrp orders. + """ + _name = 'order.mrp.merge' + _description = 'Merge mrp orders' + _check_company_auto = True + + def _default_merge_line_ids(self): + """ + Default record in merge line based on selected mrp orders that help + us to manage merge quantity. + """ + order_id = self.env['mrp.production'].browse( + self.env.context.get('records')) + order = order_id.mapped('id') + quantity = sum(order_id.mapped('product_qty')) + return [(0, 0, + {'mrp_merge_order_ids': order, + 'mrp_product_id': order_id[0].product_id.id, + 'quantity': quantity + })] + + def _get_default_merge_type(self): + """Default merge type in the wizard that selected in settings""" + merge_type = self.env['ir.config_parameter'].sudo().get_param( + 'odoo_merge_mrp_orders.merge_mrp_type') + return merge_type + + def _default_manage_qty(self): + """Function to get default value of merge quantity from settings.""" + merge_qty = self.env['ir.config_parameter'].sudo().get_param( + 'odoo_merge_mrp_orders.merge_qty') + return merge_qty + + product_id = fields.Many2one( + string="Product", + comodel_name='product.product', + help='Merge order product' + ) + bom_id = fields.Many2one( + string="Bill of material", + comodel_name='mrp.bom', + help='Information of merge order bill of material' + ) + production_ids = fields.Many2many( + string="Production Orders", + comodel_name='mrp.production', + relation='mrp_productions_rel', + compute='_compute_production_ids', + help='Field used to return domain for mrp_order_id' + ) + company_id = fields.Many2one( + string='Company', + comodel_name='res.company', + index=True, + default=lambda self: self.env.company, + help='Company associated with the order.' + ) + merge_mrp_type = fields.Selection( + string="Merge Type", + selection=[ + ('order_none', "New order and Do nothing with selected mrp orders"), + ('order_cancel', "New order and Cancel selected mrp orders"), + ('order_remove', "New order and Remove selected mrp orders"), + ('merge_none', + "Existing order and Do nothing with selected mrp orders"), + ('merge_cancel', "Existing order and Cancel selected mrp orders"), + ('merge_remove', "Existing order and Remove selected mrp orders") + ], + default=_get_default_merge_type, + required=True, + help='Type of merge operation to be performed.' + ) + component_location_id = fields.Many2one( + comodel_name='stock.location', + string="Component Location", + required=True, + check_company=True, + help='Component location for the merge operation' + ) + component_destination_location_id = fields.Many2one( + comodel_name='stock.location', + string="Finished Product Location", + required=True, + check_company=True, + help='Location for the finished product resulting from the merge ' + 'operation.' + ) + mrp_order_id = fields.Many2one( + comodel_name='mrp.production', + check_company=True, + help='Manufacturing order to which the merge operation will be applied.' + ) + merge_line_ids = fields.One2many( + string='Merge lines', + comodel_name='mrp.merge.line', + inverse_name='merge_order_id', + default=_default_merge_line_ids, + help='Merge lines representing merge quantities for specific products.' + ) + manage_qty = fields.Boolean( + string='Manage Quantity', + default=_default_manage_qty, + help='Determines if merge quantity should be managed.' + ) + + @api.depends('merge_mrp_type') + def _compute_production_ids(self): + """ + Compute method for the 'production_ids' field. + + This method is called when the 'merge_mrp_type' field is changed. + It computes the 'production_ids' based on the selected merge + type.""" + if self.merge_mrp_type in ['merge_none', 'merge_cancel', + 'merge_remove']: + production_ids = self.env['mrp.production'].search( + [('product_id', '=', self.product_id.id), + ('bom_id', '=', self.bom_id.id), + ('state', 'in', ['draft', 'confirmed']), + ('id', 'not in', self.env.context.get('records')) + ]) + self.production_ids = production_ids + else: + self.production_ids = False + + def action_merge(self): + """Button to merge selected mrp orders.""" + order_ids = self.env['mrp.production'].browse( + self.env.context.get('records')) + if self.manage_qty: + total_quantity = sum(self.merge_line_ids.mapped('quantity')) + if total_quantity > sum(order_ids.mapped('product_qty')): + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': _("User Error"), + 'type': 'warning', + 'message': "Merge quantity should be less than equal to" + "order's total quantity", + 'next': {'type': 'ir.actions.act_window_close'}, + } + } + else: + total_quantity = sum(order_ids.mapped('product_qty')) + merge_type = self.merge_mrp_type + if merge_type in ['order_none', 'order_cancel', 'order_remove']: + total_quantity = sum(order_ids.mapped('product_qty')) + location_src_id = self.component_location_id.id + location_dest_id = self.component_destination_location_id.id + self.merge_manufacturing_order(order_ids, total_quantity, + location_src_id, location_dest_id) + if merge_type == 'order_cancel': + order_ids.action_cancel() + elif merge_type == 'order_remove': + order_ids.unlink() + elif merge_type in ['merge_none', 'merge_cancel', 'merge_remove']: + total_qty = total_quantity + self.merge_to_manufacturing_order(total_qty) + if merge_type == 'merge_cancel': + order_ids.action_cancel() + elif merge_type == 'merge_remove': + order_ids.unlink() + + def merge_manufacturing_order(self, order_ids, total_quantity, + location_src_id, location_dest_id): + """Creating a new manufacturing order based on selected mrp orders.""" + if self.manage_qty: + total_quantity = self.merge_line_ids.quantity + mrp_order = self.env['mrp.production'].create([{ + 'product_id': order_ids[0].product_id.id, + 'product_qty': total_quantity, + 'product_uom_qty': total_quantity, + 'qty_produced': total_quantity, + 'product_uom_id': order_ids[0].product_uom_id.id, + 'bom_id': order_ids[0].bom_id.id, + 'origin': order_ids[0].origin, + 'location_src_id': location_src_id, + 'location_dest_id': location_dest_id, + }]) + mrp_order._compute_product_uom_qty() + mrp_order._compute_state() + mrp_order._onchange_product_qty() + mrp_order._onchange_move_raw() + mrp_order._onchange_move_finished() + name = '' + for value in range(len(order_ids)): + if value == 0: + name += order_ids[value].name + else: + name += ',' + order_ids[value].name + if self.notification_in_chatter_check(): + message = _( + "This mrp order is created from %s") % name + mrp_order.message_post(body=message) + + def merge_to_manufacturing_order(self, total_qty): + """Merge the mrp orders to a selected order.""" + self.mrp_order_id.write({ + 'product_qty': total_qty + int(self.mrp_order_id.product_qty) + }) + self.mrp_order_id._compute_product_uom_qty() + self.mrp_order_id._compute_state() + self.mrp_order_id._onchange_product_qty() + self.mrp_order_id._onchange_move_raw() + self.mrp_order_id._onchange_move_finished() + order_ids = self.env['mrp.production'].browse( + self.env.context.get('records')) + name = '' + for value in range(len(order_ids)): + if value == 0: + name += order_ids[value].name + else: + name += ',' + order_ids[value].name + if self.notification_in_chatter_check(): + message = _( + "This mrp order is created from %s") % name + self.mrp_order_id.message_post(body=message) + + def notification_in_chatter_check(self): + """Check notify in the chatter options is enabled in settings.""" + result = self.env['ir.config_parameter'].sudo().get_param( + 'odoo_merge_mrp_orders.merge_order_notify') + return result + + @api.onchange('mrp_order_id') + def _onchange_mrp_order_id(self): + """ + Update the quantity in merge_line_ids based on the selected + mrp_order_id. + """ + order_ids = self.env['mrp.production'].browse( + self.env.context.get('records')) + total = sum(order_ids.mapped('product_qty')) + order = order_ids.mapped('id') + + if self.mrp_order_id and self.merge_mrp_type in ['merge_none', + 'merge_cancel', + 'merge_remove']: + order += [self.mrp_order_id.id] + total += self.mrp_order_id.product_qty + + self.merge_line_ids.write({ + 'mrp_merge_order_ids': [(6, 0, order)], + 'quantity': total + }) + + +class MrpMergeLine(models.TransientModel): + """ + Merge line to manage merge quantity + """ + _name = 'mrp.merge.line' + _description = 'MRP merge line' + + merge_order_id = fields.Many2one( + string='Merge order', + comodel_name='order.mrp.merge', + help='Inverse field linking back to the order.mrp.merge model, ' + 'representing the merge order.' + ) + mrp_merge_order_ids = fields.Many2many( + string='Orders', + comodel_name='mrp.production', + help='This field represents the list of MRP orders that are being' + ' merged together.') + mrp_product_id = fields.Many2one( + string='Product', + comodel_name='product.product', + help='Product associated with the mrp order.') + quantity = fields.Integer(string='Quantity', help='Quantity of the merge ' + 'order') diff --git a/odoo_merge_mrp_orders/wizard/order_mrp_merge_views.xml b/odoo_merge_mrp_orders/wizard/order_mrp_merge_views.xml new file mode 100644 index 000000000..d48eaa35c --- /dev/null +++ b/odoo_merge_mrp_orders/wizard/order_mrp_merge_views.xml @@ -0,0 +1,69 @@ + + + + order.mrp.merge.view.form + order.mrp.merge + form + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+