From 68998f5a42a0740060d74107d108181b1dfcfb2d Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 13 Nov 2024 15:34:00 +0700 Subject: comment fulfillment v1 --- .../models/report_stock_forecasted.py | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/indoteknik_custom/models/report_stock_forecasted.py b/indoteknik_custom/models/report_stock_forecasted.py index ebdc7d4a..c9d54a15 100644 --- a/indoteknik_custom/models/report_stock_forecasted.py +++ b/indoteknik_custom/models/report_stock_forecasted.py @@ -6,33 +6,33 @@ class ReplenishmentReport(models.AbstractModel): @api.model def _get_report_lines(self, product_template_ids, product_variant_ids, wh_location_ids): lines = super(ReplenishmentReport, self)._get_report_lines(product_template_ids, product_variant_ids, wh_location_ids) - result_dict = {} - - for line in lines: - document_out = line.get('document_out') - - if document_out and "SO/" in document_out.name: - order_id = document_out.id - if document_out == False: - continue - product_id = line.get('product', {}).get('id') - query = [('product_id', '=', product_id)] - - if order_id: - result = self._calculate_result(line) - quantity = line.get('quantity', 0) - result_dict.setdefault(order_id, []).append((result, quantity)) - - for order_id, results in result_dict.items(): - sales_order = self.env['sale.order'].browse(order_id) - - for result, quantity in results: - self.env['sales.order.fullfillment'].create({ - 'sales_order_id': sales_order.id, - 'product_id': product_id, - 'reserved_from': result, - 'qty_fullfillment': quantity, - }) + # result_dict = {} + # + # for line in lines: + # document_out = line.get('document_out') + # + # if document_out and "SO/" in document_out.name: + # order_id = document_out.id + # if document_out == False: + # continue + # product_id = line.get('product', {}).get('id') + # query = [('product_id', '=', product_id)] + # + # if order_id: + # result = self._calculate_result(line) + # quantity = line.get('quantity', 0) + # result_dict.setdefault(order_id, []).append((result, quantity)) + # + # for order_id, results in result_dict.items(): + # sales_order = self.env['sale.order'].browse(order_id) + # + # for result, quantity in results: + # self.env['sales.order.fullfillment'].create({ + # 'sales_order_id': sales_order.id, + # 'product_id': product_id, + # 'reserved_from': result, + # 'qty_fullfillment': quantity, + # }) return lines def _calculate_result(self, line): -- cgit v1.2.3