From 9ae65ca732475a41f4055264b0e068bc607de759 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 21 Jan 2025 09:44:55 +0700 Subject: cr forecast --- .../models/report_stock_forecasted.py | 49 +--------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/indoteknik_custom/models/report_stock_forecasted.py b/indoteknik_custom/models/report_stock_forecasted.py index c9d54a15..37082869 100644 --- a/indoteknik_custom/models/report_stock_forecasted.py +++ b/indoteknik_custom/models/report_stock_forecasted.py @@ -1,51 +1,4 @@ from odoo import api, models class ReplenishmentReport(models.AbstractModel): - _inherit = 'report.stock.report_product_product_replenishment' - - @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, - # }) - return lines - - def _calculate_result(self, line): - if line['document_in']: - return str(line["document_in"].name) - elif line['reservation'] and not line['document_in']: - return 'Reserved from stock' - elif line['replenishment_filled']: - if line['document_out']: - return 'Inventory On Hand' - else: - return 'Free Stock' - else: - return 'Unfulfilled' - - + _inherit = 'report.stock.report_product_product_replenishment' \ No newline at end of file -- cgit v1.2.3