From 09214145e1ba413df24048eb0fca76c3818f72a0 Mon Sep 17 00:00:00 2001 From: Ajmal JK Date: Thu, 19 Mar 2020 11:39:53 +0530 Subject: [PATCH] [FIX] Bug Fixed 'pos_mrp_order' --- pos_mrp_order/__manifest__.py | 2 +- pos_mrp_order/models/point_of_sale_make_mrp.py | 18 +++++++++++++++++- pos_mrp_order/static/src/js/models.js | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pos_mrp_order/__manifest__.py b/pos_mrp_order/__manifest__.py index acf3e24e1..6a8065174 100644 --- a/pos_mrp_order/__manifest__.py +++ b/pos_mrp_order/__manifest__.py @@ -20,7 +20,7 @@ ############################################################################## { 'name': 'Make MRP orders from POS', - 'version': '13.0.1.0.0', + 'version': '13.0.1.0.1', 'summary': """Launch Automatic MRP Orders After Selling Through POS.""", 'description': """Launch automatic MRP orders after selling through POS""", 'author': 'Cybrosys Techno Solutions', diff --git a/pos_mrp_order/models/point_of_sale_make_mrp.py b/pos_mrp_order/models/point_of_sale_make_mrp.py index 829c6f90b..f9eaa57be 100644 --- a/pos_mrp_order/models/point_of_sale_make_mrp.py +++ b/pos_mrp_order/models/point_of_sale_make_mrp.py @@ -62,7 +62,23 @@ class MrpProduction(models.Model): 'product_qty': prod['qty'], 'bom_id': bom.id, } - self.sudo().create(vals) + 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, + '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, + + })) + mrp_order.update({'move_raw_ids':list_value}) + return True diff --git a/pos_mrp_order/static/src/js/models.js b/pos_mrp_order/static/src/js/models.js index 1997d2bb0..cfc66f6d6 100644 --- a/pos_mrp_order/static/src/js/models.js +++ b/pos_mrp_order/static/src/js/models.js @@ -23,6 +23,7 @@ pos_screens.PaymentScreenWidget.include({ for (var i in order_line) { var list_product = [] + console.log("order_line[i].product.to_make_mrp",order_line[i].product) if (order_line[i].product.to_make_mrp) { if (order_line[i].quantity>0)