diff --git a/pos_mrp_order/README.rst b/pos_mrp_order/README.rst new file mode 100644 index 000000000..b015ed0ed --- /dev/null +++ b/pos_mrp_order/README.rst @@ -0,0 +1,53 @@ +.. image:: https://img.shields.io/badge/license-AGPL--1-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Make MRP orders from POS v14 +============================ + +* From the POS sale we need to generate MRP orders in the back end with out close the current window. +* Automatically create MRP order form POS sale. +* We can assign which products make MRP order Automatically. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, v3.0 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: V10 Nikhil Krishnan @ cybrosys, odoo@cybrosys.com + V12 Akshay Babu @cybrosys, odoo@cybrosys.com + V13 Vaishnavi B @cybrosys, odoo@cybrosys.com + V14 Sajna Sherin T @cybrosys, odoo@cybrosys.com + V15 Sagarika B @cybrosys, 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 +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/pos_mrp_order/__init__.py b/pos_mrp_order/__init__.py new file mode 100644 index 000000000..337765372 --- /dev/null +++ b/pos_mrp_order/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/pos_mrp_order/__manifest__.py b/pos_mrp_order/__manifest__.py new file mode 100644 index 000000000..abf5e483c --- /dev/null +++ b/pos_mrp_order/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Make MRP orders from POS', + 'version': '14.0.1.0.0', + 'summary': """Launch Automatic MRP Orders After Selling Through POS.""", + 'description': """Implement an automated process to launch Manufacturing + Resource Planning (MRP) orders whenever a product is sold through the + Point of Sale (POS) system. """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Point of Sale', + 'depends': ['point_of_sale', 'mrp', 'stock'], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_template_view.xml', + 'views/pos_assets_view.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_mrp_order/doc/RELEASE_NOTES.md b/pos_mrp_order/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b54c95c5f --- /dev/null +++ b/pos_mrp_order/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 13.05.2024 +#### Version 14.0.1.0.0 +##### ADD + +- Initial Commit for Make MRP orders from POS diff --git a/pos_mrp_order/models/__init__.py b/pos_mrp_order/models/__init__.py new file mode 100644 index 000000000..6c3a219ef --- /dev/null +++ b/pos_mrp_order/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import mrp_production +from . import product_product +from . import product_template diff --git a/pos_mrp_order/models/mrp_production.py b/pos_mrp_order/models/mrp_production.py new file mode 100644 index 000000000..48acb2d8c --- /dev/null +++ b/pos_mrp_order/models/mrp_production.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import models + + +class MrpProduction(models.Model): + """Inheriting mrp production model to create MO from POS""" + _inherit = 'mrp.production' + + def create_mrp_from_pos(self, products): + """Function that creates MO order from the POS""" + product_ids = [] + if products: + for product in products: + flag = 1 + if product_ids: + for product_id in product_ids: + if product_id['id'] == product['id']: + product_id['qty'] += product['qty'] + flag = 0 + if flag: + product_ids.append(product) + for prod in product_ids: + if prod['qty'] > 0: + product = self.env['product.product'].search( + [('id', '=', prod['id'])]) + bom_count = self.env['mrp.bom'].search( + [('product_tmpl_id', '=', prod['product_tmpl_id'])]) + if bom_count: + bom_temp = self.env['mrp.bom'].search( + [('product_tmpl_id', '=', prod['product_tmpl_id']), + ('product_id', '=', False)]) + bom_prod = self.env['mrp.bom'].search( + [('product_id', '=', prod['id'])]) + if bom_prod: + bom = bom_prod[0] + elif bom_temp: + bom = bom_temp[0] + else: + bom = [] + if bom: + vals = { + 'origin': 'POS-' + prod['pos_reference'], + 'state': 'confirmed', + 'product_id': prod['id'], + 'product_tmpl_id': prod['product_tmpl_id'], + 'product_uom_id': prod['uom_id'], + 'product_qty': prod['qty'], + 'bom_id': bom.id, + } + mrp_order = self.sudo().create(vals) + list_value = [] + for bom_line in mrp_order.bom_id.bom_line_ids: + list_value.append((0, 0, { + 'raw_material_production_id': mrp_order.id, + 'name': mrp_order.name, + 'product_id': bom_line.product_id.id, + 'product_uom': bom_line.product_uom_id.id, + 'product_uom_qty': (bom_line.product_qty * mrp_order.product_qty)/self.env['mrp.bom'].search([("product_tmpl_id", "=", prod['product_tmpl_id'])]).product_qty, + 'location_id': mrp_order.location_src_id.id, + 'location_dest_id': bom_line.product_id.with_company( + self.company_id.id).property_stock_production.id, + 'company_id': mrp_order.company_id.id, + 'quantity_done': 0, + 'operation_id': False + })) + finished_vals = { + 'product_id': prod['id'], + 'product_uom_qty': prod['qty'], + 'product_uom': prod['uom_id'], + 'name': mrp_order.name, + 'date_deadline': mrp_order.date_deadline, + 'picking_type_id': mrp_order.picking_type_id.id, + 'location_id': mrp_order.location_src_id.id, + 'location_dest_id': mrp_order.location_dest_id.id, + 'company_id': mrp_order.company_id.id, + 'production_id': mrp_order.id, + 'warehouse_id': mrp_order.location_dest_id.get_warehouse().id, + 'origin': mrp_order.name, + 'group_id': mrp_order.procurement_group_id.id, + 'propagate_cancel': mrp_order.propagate_cancel, + } + mrp_order.update({'move_raw_ids': list_value, + 'move_finished_ids': [ + (0, 0, finished_vals)] + }) + mrp_order.action_confirm() + return True diff --git a/pos_mrp_order/models/product_product.py b/pos_mrp_order/models/product_product.py new file mode 100644 index 000000000..7440c68a8 --- /dev/null +++ b/pos_mrp_order/models/product_product.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, models + + +class ProductProduct(models.Model): + """Inheriting product.product model""" + _inherit = 'product.product' + + @api.onchange('to_make_mrp') + def onchange_to_make_mrp(self): + """If there is no BOM for the selected product it shows warning""" + if self.to_make_mrp: + if not self.bom_count: + raise Warning('Please set Bill of Material for this product.') diff --git a/pos_mrp_order/models/product_template.py b/pos_mrp_order/models/product_template.py new file mode 100644 index 000000000..82ae4208a --- /dev/null +++ b/pos_mrp_order/models/product_template.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Sajna Sherin(odoo@cybrosys.com) +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class ProductTemplate(models.Model): + """Inherit product template model""" + _inherit = 'product.template' + + to_make_mrp = fields.Boolean(string='To Create MRP Order', + help="Check if the product should be " + "make mrp order") + + @api.onchange('to_make_mrp') + def onchange_to_make_mrp(self): + """Onchange function to show validation error if there is no + BOM for the product""" + if self.to_make_mrp: + if not self.bom_count: + raise ValidationError( + 'Please set Bill of Material for this product.') diff --git a/pos_mrp_order/security/ir.model.access.csv b/pos_mrp_order/security/ir.model.access.csv new file mode 100644 index 000000000..c4fc267f4 --- /dev/null +++ b/pos_mrp_order/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_mrp_production_pos_user,mrp.production.pos.user,mrp.model_mrp_production,point_of_sale.group_pos_user,1,1,1,0 +access_mrp_bom_pos_user,mrp.bom.pos.user,mrp.model_mrp_bom,point_of_sale.group_pos_user,1,0,0,0 diff --git a/pos_mrp_order/static/description/assets/icons/check.png b/pos_mrp_order/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/check.png differ diff --git a/pos_mrp_order/static/description/assets/icons/chevron.png b/pos_mrp_order/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/chevron.png differ diff --git a/pos_mrp_order/static/description/assets/icons/cogs.png b/pos_mrp_order/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/cogs.png differ diff --git a/pos_mrp_order/static/description/assets/icons/consultation.png b/pos_mrp_order/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/consultation.png differ diff --git a/pos_mrp_order/static/description/assets/icons/ecom-black.png b/pos_mrp_order/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/ecom-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/education-black.png b/pos_mrp_order/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/education-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/hotel-black.png b/pos_mrp_order/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/hotel-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/license.png b/pos_mrp_order/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/license.png differ diff --git a/pos_mrp_order/static/description/assets/icons/lifebuoy.png b/pos_mrp_order/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_mrp_order/static/description/assets/icons/logo.png b/pos_mrp_order/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/logo.png differ diff --git a/pos_mrp_order/static/description/assets/icons/manufacturing-black.png b/pos_mrp_order/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/pos-black.png b/pos_mrp_order/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/pos-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/puzzle.png b/pos_mrp_order/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/puzzle.png differ diff --git a/pos_mrp_order/static/description/assets/icons/restaurant-black.png b/pos_mrp_order/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/service-black.png b/pos_mrp_order/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/service-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/trading-black.png b/pos_mrp_order/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/trading-black.png differ diff --git a/pos_mrp_order/static/description/assets/icons/training.png b/pos_mrp_order/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/training.png differ diff --git a/pos_mrp_order/static/description/assets/icons/update.png b/pos_mrp_order/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/update.png differ diff --git a/pos_mrp_order/static/description/assets/icons/user.png b/pos_mrp_order/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/user.png differ diff --git a/pos_mrp_order/static/description/assets/icons/wrench.png b/pos_mrp_order/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_mrp_order/static/description/assets/icons/wrench.png differ diff --git a/pos_mrp_order/static/description/assets/modules/1.png b/pos_mrp_order/static/description/assets/modules/1.png new file mode 100644 index 000000000..1217263a6 Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/1.png differ diff --git a/pos_mrp_order/static/description/assets/modules/2.png b/pos_mrp_order/static/description/assets/modules/2.png new file mode 100644 index 000000000..6f604a403 Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/2.png differ diff --git a/pos_mrp_order/static/description/assets/modules/3.png b/pos_mrp_order/static/description/assets/modules/3.png new file mode 100644 index 000000000..6f28da108 Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/3.png differ diff --git a/pos_mrp_order/static/description/assets/modules/4.png b/pos_mrp_order/static/description/assets/modules/4.png new file mode 100644 index 000000000..3afc14722 Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/4.png differ diff --git a/pos_mrp_order/static/description/assets/modules/5.png b/pos_mrp_order/static/description/assets/modules/5.png new file mode 100644 index 000000000..cea66b05f Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/5.png differ diff --git a/pos_mrp_order/static/description/assets/modules/6.png b/pos_mrp_order/static/description/assets/modules/6.png new file mode 100644 index 000000000..0c9bb377e Binary files /dev/null and b/pos_mrp_order/static/description/assets/modules/6.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/1.png b/pos_mrp_order/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..fc339ca63 Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/1.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/2.png b/pos_mrp_order/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..c0bc772c4 Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/2.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/3.png b/pos_mrp_order/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..5514f7cc9 Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/3.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/4.png b/pos_mrp_order/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..0d09b1546 Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/4.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/5.png b/pos_mrp_order/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..bd24bd56e Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/5.png differ diff --git a/pos_mrp_order/static/description/assets/screenshots/hero.gif b/pos_mrp_order/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..485a1f693 Binary files /dev/null and b/pos_mrp_order/static/description/assets/screenshots/hero.gif differ diff --git a/pos_mrp_order/static/description/banner.jpg b/pos_mrp_order/static/description/banner.jpg new file mode 100644 index 000000000..bbb3f4172 Binary files /dev/null and b/pos_mrp_order/static/description/banner.jpg differ diff --git a/pos_mrp_order/static/description/icon.png b/pos_mrp_order/static/description/icon.png new file mode 100644 index 000000000..04722416c Binary files /dev/null and b/pos_mrp_order/static/description/icon.png differ diff --git a/pos_mrp_order/static/description/index.html b/pos_mrp_order/static/description/index.html new file mode 100644 index 000000000..c1828baff --- /dev/null +++ b/pos_mrp_order/static/description/index.html @@ -0,0 +1,622 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Make MRP Orders from POS

+

+ Launch automatic MRP orders after selling through POS +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ The module automatically launches MRP orders from Point of Sale.

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Automatic MRP Orders form POS Sale.

+

+ Automatically create MRP order form POS sale.

+
+
+
+
+ +
+
+

+ Assign products for which automatic MRP to be created +

+

+ We have to assign the products for which MRP order gets created Automatically.

+
+
+
+
+ +
+
+

+ Identify POS generated MRP orders easily

+

+ Identify the MRP orders easily generated from POS.

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ Enable MRP order creation from POS

+

+ How to enable MRP order creation from POS.

+ +
+
+

+ Create MRP Order. Warning is Shown if the Product does not Have a Bill of Material

+

+ Enable 'To create MRP order' + and make sure that this product has a bill of material, else system will generate a warning. If you + forget to set the BOM, then MRP order does not get created.

+ +
+ +
+

+ Bill of Material

+

+ Every product needs minimum one BoM, then only MRP order gets created at the time of POS sale. If + you do not enable the Product Variants, then you can set a BoM with a product and its components. If + you enable the Product Variants (Products can have several attributes, defining variants (Example: + size, color...)) then the BoM form will contain extra field Product Variant. +

+ If you set a BoM for a product template, then you will be able to get that BoM for all the variants. +

+ If you set a BoM for a particular Product variants, then that BoM is counted only for that variant. +

+ So other variants BoM is counted as zero. MRP Order is created only when the BoM is available. +

+ +
+ +
+

+ Point Of Sale

+

+ Select the products for sale.

+ Make the payments and validate it.

+ Check Manufacturing orders. +

+ +
+ +
+

+ Find out the MRP orders that is created by POS

+

+ From the "Source", we can easily find out the MRP orders that is created by POS. +

+ +
+ +
+ +
+
+

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/pos_mrp_order/static/src/js/mrp_order.js b/pos_mrp_order/static/src/js/mrp_order.js new file mode 100644 index 000000000..191f69060 --- /dev/null +++ b/pos_mrp_order/static/src/js/mrp_order.js @@ -0,0 +1,71 @@ +odoo.define('pos_mrp_order.models_mrp_order', function (require) { +"use strict"; +const PaymentScreen = require('point_of_sale.PaymentScreen'); +const Registries = require('point_of_sale.Registries'); +var models = require('point_of_sale.models'); +var rpc = require('web.rpc'); + +// checking the boolean field and creating the MRP from +// POS if the boolean field is true + var existing_models = models.PosModel.prototype.models; + var product_index = _.findIndex(existing_models, function (model) { + return model.model === "product.product"; + }); + var product_model = existing_models[product_index]; + product_model.fields.push('to_make_mrp'); +// extending the POS payment screen and creating MO + const MRPPaymentScreen = (PaymentScreen) => + class extends PaymentScreen { + constructor() { + super(...arguments); + } + createMRP(){ + const order = this.currentOrder; + var order_line = order.orderlines.models; + var due = order.get_due(); + for (var i in order_line) { + var list_product = [] + if (order_line[i].product.to_make_mrp) { + if (order_line[i].quantity>0) { + var product_dict = { + 'id': order_line[i].product.id, + 'qty': order_line[i].quantity, + 'product_tmpl_id': order_line[i].product.product_tmpl_id, + 'pos_reference': order.name, + 'uom_id': order_line[i].product.uom_id[0], + }; + list_product.push(product_dict); + } + } + if (list_product.length) { + rpc.query({ + model: 'mrp.production', + method: 'create_mrp_from_pos', + args: [1,list_product], + }); + } + } + } + async validateOrder(isForceValidate) { + if(this.env.pos.config.cash_rounding) { + if(!this.env.pos.get_order().check_paymentlines_rounding()) { + this.showPopup('ErrorPopup', { + title: this.env._t('Rounding error in payment lines'), + body: this.env._t("The amount of your payment lines must be rounded to validate the transaction."), + }); + return; + } + } + if (await this._isOrderValid(isForceValidate)) { + // remove pending payments before finalizing the validation + for (let line of this.paymentLines) { + if (!line.is_done()) this.currentOrder.remove_paymentline(line); + } + await this._finalizeValidation(); + } + this.createMRP(); + } + }; + Registries.Component.extend(PaymentScreen, MRPPaymentScreen); + return MRPPaymentScreen; +}); diff --git a/pos_mrp_order/views/pos_assets_view.xml b/pos_mrp_order/views/pos_assets_view.xml new file mode 100644 index 000000000..eb60e549c --- /dev/null +++ b/pos_mrp_order/views/pos_assets_view.xml @@ -0,0 +1,9 @@ + + + +