From 67ceacdd48ba0ed5fdeb7eb7ee8c58d276c6c953 Mon Sep 17 00:00:00 2001 From: Tu Nombre Date: Tue, 17 Sep 2024 09:06:27 +0200 Subject: [PATCH] [14.0][IMP] custom_mrp_descarga: Change grouping. --- .../mrp_production_quartering_summary_xlsx.py | 16 ++++++++-------- .../views/mrp_production_view.xml | 5 +++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.py b/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.py index b56cccf11..b71291cd1 100644 --- a/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.py +++ b/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.py @@ -129,10 +129,10 @@ def generate_xlsx_report(self, workbook, data, objects): total_entry_pallet_weight = 0 total_entry_container_weight = 0 for line in entry_movelines: - if line.product_category_id not in categories: - categories.append(line.product_category_id) + if line.product_family_id not in categories: + categories.append(line.product_family_id) categ_lines = entry_movelines.filtered( - lambda c: c.product_category_id == line.product_category_id + lambda c: c.product_family_id == line.product_family_id ) categ_pallet = sum(categ_lines.mapped("pallet")) categ_container = sum(categ_lines.mapped("container")) @@ -253,7 +253,7 @@ def generate_xlsx_report(self, workbook, data, objects): n += 1 m = 0 worksheet.write( - n, m, line.product_category_id.display_name, result_int_format + n, m, line.product_family_id.display_name, result_int_format ) m += 1 worksheet.write(n, m, "", result_int_format) @@ -338,10 +338,10 @@ def generate_xlsx_report(self, workbook, data, objects): total_out_container_weight = 0 out_movelines = objects.mapped("finished_move_line_ids") for line in out_movelines: - if line.product_category_id not in categories: - categories.append(line.product_category_id) + if line.product_family_id not in categories: + categories.append(line.product_family_id) categ_lines = out_movelines.filtered( - lambda c: c.product_category_id == line.product_category_id + lambda c: c.product_family_id == line.product_family_id ) categ_pallet = sum(categ_lines.mapped("pallet")) categ_container = sum(categ_lines.mapped("container")) @@ -449,7 +449,7 @@ def generate_xlsx_report(self, workbook, data, objects): n += 1 m = 0 worksheet.write( - n, m, line.product_category_id.display_name, result_int_format + n, m, line.product_family_id.display_name, result_int_format ) m += 1 worksheet.write(n, m, "", result_int_format) diff --git a/custom_mrp_descarga/views/mrp_production_view.xml b/custom_mrp_descarga/views/mrp_production_view.xml index 39eff310c..3a8403765 100644 --- a/custom_mrp_descarga/views/mrp_production_view.xml +++ b/custom_mrp_descarga/views/mrp_production_view.xml @@ -675,6 +675,9 @@ + + + @@ -719,8 +722,10 @@ + +