diff --git a/cancel_mrp_order/README.rst b/cancel_mrp_order/README.rst new file mode 100644 index 000000000..7d02f22c8 --- /dev/null +++ b/cancel_mrp_order/README.rst @@ -0,0 +1,42 @@ +Cancel Manufacturing Order +========================== +* Cancel Manufacturing Orders For Odoo 15 community And Enterprise editions + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(v15) Arunima @ Cybrosys + + +Contacts +-------- +* Mail Contact : odoo@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. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ + diff --git a/cancel_mrp_order/__init__.py b/cancel_mrp_order/__init__.py new file mode 100644 index 000000000..b1dbc9c05 --- /dev/null +++ b/cancel_mrp_order/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/cancel_mrp_order/__manifest__.py b/cancel_mrp_order/__manifest__.py new file mode 100644 index 000000000..1a4c7a8bc --- /dev/null +++ b/cancel_mrp_order/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Cancel Manufacturing Order', + 'version': '15.0.1.0.0', + 'summary': 'Allows users to cancel done manufacturing order', + 'description': 'Allows users to cancel done manufacturing order', + 'category': 'Manufacturing', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'mrp'], + 'data': [ + 'security/security.xml', + 'views/mrp_production.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'auto_install': False, +} diff --git a/cancel_mrp_order/doc/RELEASE_NOTES.md b/cancel_mrp_order/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..643b341c8 --- /dev/null +++ b/cancel_mrp_order/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 24.07.2022 +#### Version 15.0.1.0.0 +#### ADD +Initial Commit + diff --git a/cancel_mrp_order/models/__init__.py b/cancel_mrp_order/models/__init__.py new file mode 100644 index 000000000..b1499f8cf --- /dev/null +++ b/cancel_mrp_order/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import mrp_production diff --git a/cancel_mrp_order/models/mrp_production.py b/cancel_mrp_order/models/mrp_production.py new file mode 100644 index 000000000..df6c28c6a --- /dev/null +++ b/cancel_mrp_order/models/mrp_production.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from collections import defaultdict +from odoo import models +from odoo.tools import float_round + + +class MrpProduction(models.Model): + _inherit = 'mrp.production' + + def _create_move_from_existing_move(self, move, factor, location_id, location_dest_id): + return self.env['stock.move'].create({ + 'name': move.name, + 'date': move.create_date, + 'product_id': move.product_id.id, + 'product_uom_qty': move.product_uom_qty * factor, + 'product_uom': move.product_uom.id, + 'procure_method': 'make_to_stock', + 'location_dest_id': location_dest_id.id, + 'location_id': location_id.id, + 'warehouse_id': location_dest_id.warehouse_id.id, + 'company_id': move.company_id.id, + }) + + def button_cancel(self): + consume_moves = self.env['stock.move'] + produce_moves = self.env['stock.move'] + finished_moves = self.move_finished_ids.filtered(lambda move: move.state == 'done') + factor = self.product_qty / self.product_uom_id._compute_quantity(self.product_qty, + self.product_uom_id) + for finished_move in finished_moves: + consume_moves += self._create_move_from_existing_move(finished_move, factor, + finished_move.location_dest_id, + finished_move.location_id) + + if len(consume_moves): + consume_moves._action_confirm() + raw_moves = self.move_raw_ids.filtered(lambda move: move.state == 'done') + factor = self.product_qty / self.product_uom_id._compute_quantity(self.product_qty, + self.product_uom_id) + for raw_move in raw_moves: + produce_moves += self._create_move_from_existing_move(raw_move, factor, raw_move.location_dest_id, + self.location_dest_id) + produce_moves._action_confirm() + finished_moves = consume_moves.filtered(lambda m: m.product_id == self.product_id) + consume_moves -= finished_moves + for finished_move in finished_moves: + if finished_move.has_tracking != 'none': + self.env['stock.move.line'].create({ + 'move_id': finished_move.id, + 'qty_done': finished_move.product_uom_qty, + 'product_id': finished_move.product_id.id, + 'product_uom_id': finished_move.product_uom.id, + 'location_id': finished_move.location_id.id, + 'location_dest_id': finished_move.location_dest_id.id, + }) + else: + finished_move.quantity_done = finished_move.product_uom_qty + + qty_already_used = defaultdict(float) + for move in produce_moves | consume_moves: + if move.has_tracking != 'none': + original_move = move in produce_moves and self.move_raw_ids or self.move_finished_ids + original_move = original_move.filtered(lambda m: m.product_id == move.product_id) + needed_quantity = move.product_uom_qty + moves_lines = original_move.mapped('move_line_ids') + for move_line in moves_lines: + taken_quantity = min(needed_quantity, move_line.qty_done - qty_already_used[move_line]) + if taken_quantity: + self.env['stock.move.line'].create({ + 'move_id': move.id, + 'lot_id': move_line.lot_id.id, + 'qty_done': taken_quantity, + 'product_id': move.product_id.id, + 'product_uom_id': move_line.product_uom_id.id, + 'location_id': move.location_id.id, + 'location_dest_id': move.location_dest_id.id, + }) + needed_quantity -= taken_quantity + qty_already_used[move_line] += taken_quantity + else: + move.quantity_done = float_round(move.product_uom_qty, precision_rounding=move.product_uom.rounding) + finished_moves._action_done() + consume_moves._action_done() + produce_moves._action_done() + produced_move_line_ids = produce_moves.mapped('move_line_ids').filtered(lambda ml: ml.qty_done > 0) + consume_moves.mapped('move_line_ids').write({'produce_line_ids': [(6, 0, produced_move_line_ids.ids)]}) + raw_moves.sudo().write( + {'state': 'cancel', + }) + raw_moves.mapped( + 'move_line_ids').sudo().write({'state': 'cancel'}) + if self.sudo().mapped('workorder_ids'): + self.sudo().mapped('workorder_ids').write({'state': 'cancel'}) + self.write({'state': 'cancel'}) + + + + diff --git a/cancel_mrp_order/security/security.xml b/cancel_mrp_order/security/security.xml new file mode 100644 index 000000000..14ea2cdfc --- /dev/null +++ b/cancel_mrp_order/security/security.xml @@ -0,0 +1,7 @@ + + + + Cancel Manufacturing Orders + + + \ No newline at end of file diff --git a/cancel_mrp_order/static/description/assets/icons/check.png b/cancel_mrp_order/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/check.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/chevron.png b/cancel_mrp_order/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/chevron.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/cogs.png b/cancel_mrp_order/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/cogs.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/consultation.png b/cancel_mrp_order/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/consultation.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/ecom-black.png b/cancel_mrp_order/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/ecom-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/education-black.png b/cancel_mrp_order/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/education-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/hotel-black.png b/cancel_mrp_order/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/hotel-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/license.png b/cancel_mrp_order/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/license.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/lifebuoy.png b/cancel_mrp_order/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/lifebuoy.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/logo.png b/cancel_mrp_order/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/logo.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/manufacturing-black.png b/cancel_mrp_order/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/manufacturing-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/pos-black.png b/cancel_mrp_order/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/pos-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/puzzle.png b/cancel_mrp_order/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/puzzle.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/restaurant-black.png b/cancel_mrp_order/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/restaurant-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/service-black.png b/cancel_mrp_order/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/service-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/trading-black.png b/cancel_mrp_order/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/trading-black.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/training.png b/cancel_mrp_order/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/training.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/update.png b/cancel_mrp_order/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/update.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/user.png b/cancel_mrp_order/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/user.png differ diff --git a/cancel_mrp_order/static/description/assets/icons/wrench.png b/cancel_mrp_order/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/cancel_mrp_order/static/description/assets/icons/wrench.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/customer_so_history.png b/cancel_mrp_order/static/description/assets/modules/customer_so_history.png new file mode 100644 index 000000000..a49d2394c Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/customer_so_history.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/individual_product_report.png b/cancel_mrp_order/static/description/assets/modules/individual_product_report.png new file mode 100644 index 000000000..cd5d80e40 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/individual_product_report.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/sale_discount_total.png b/cancel_mrp_order/static/description/assets/modules/sale_discount_total.png new file mode 100644 index 000000000..924a65196 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/sale_discount_total.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/sale_report_advanced.png b/cancel_mrp_order/static/description/assets/modules/sale_report_advanced.png new file mode 100644 index 000000000..1c019bdd8 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/sale_report_advanced.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/sale_report_format_editor.png b/cancel_mrp_order/static/description/assets/modules/sale_report_format_editor.png new file mode 100644 index 000000000..c58491994 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/sale_report_format_editor.png differ diff --git a/cancel_mrp_order/static/description/assets/modules/sales_order_delivery_status.png b/cancel_mrp_order/static/description/assets/modules/sales_order_delivery_status.png new file mode 100644 index 000000000..94c023fe1 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/modules/sales_order_delivery_status.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order1.png b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order1.png new file mode 100644 index 000000000..df802341e Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order1.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order2.png b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order2.png new file mode 100644 index 000000000..33a01ef1c Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order2.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order3.png b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order3.png new file mode 100644 index 000000000..aef7f655d Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order3.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order4.png b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order4.png new file mode 100644 index 000000000..39f38a037 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order4.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order5.png b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order5.png new file mode 100644 index 000000000..57fe686c4 Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/cancel_mrp_order5.png differ diff --git a/cancel_mrp_order/static/description/assets/screenshots/hero.gif b/cancel_mrp_order/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..af327ca4e Binary files /dev/null and b/cancel_mrp_order/static/description/assets/screenshots/hero.gif differ diff --git a/cancel_mrp_order/static/description/banner.png b/cancel_mrp_order/static/description/banner.png new file mode 100644 index 000000000..eb7ebcdff Binary files /dev/null and b/cancel_mrp_order/static/description/banner.png differ diff --git a/cancel_mrp_order/static/description/icon.png b/cancel_mrp_order/static/description/icon.png new file mode 100644 index 000000000..1ddd8cf8a Binary files /dev/null and b/cancel_mrp_order/static/description/icon.png differ diff --git a/cancel_mrp_order/static/description/index.html b/cancel_mrp_order/static/description/index.html new file mode 100644 index 000000000..4c31a76e8 --- /dev/null +++ b/cancel_mrp_order/static/description/index.html @@ -0,0 +1,597 @@ +
+ +
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Cancel Manufacturing Order

+

+ Cancel Manufacturing Order +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+This module allows users to cancel the already done Manufacturing Orders +

+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Community & Enterprise Support

+

+ Available in Odoo 15.0 Community and Enterprise.

+
+
+ +
+
+ +
+
+

+ Allows to cancel Done Manufacturing Order

+
+
+ +
+
+ +
+
+

+ Cancel done stock moves and reverse the stock

+
+
+ +
+
+ +
+
+

+ Cancel Finished work orders

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ User who have the Access right 'Cancel Manufacturing Orders' can cancel the 'Done' manufacturing orders

+ +
+ +
+

+ Users who have the Access right to 'Cancel Manufacturing Orders' can see the button 'Cancel' in 'Done' Manufacturing orders

+ +
+ +
+

+ The current stock of one of the product is this

+ + +
+ +
+

+ When clicking the 'Cancel' button the order state goes to 'Cancelled'

+ +
+
+

+ The inventory of product is reversed in the system

+ +
+ +
+ + +
+
+

Suggested 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

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
diff --git a/cancel_mrp_order/views/mrp_production.xml b/cancel_mrp_order/views/mrp_production.xml new file mode 100644 index 000000000..5eb5dae87 --- /dev/null +++ b/cancel_mrp_order/views/mrp_production.xml @@ -0,0 +1,14 @@ + + + + mrp.production.form.inherited + mrp.production + + + +