Skip to content

Commit b6f83c4

Browse files
luciaavanzoscanajuaristi
authored andcommitted
[14.0][IMP] custom_mrp_descarga: Sort out movelines by specific family order.
1 parent 5b913a4 commit b6f83c4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,22 @@ def generate_xlsx_report(self, workbook, data, objects):
338338
products = []
339339
total_out_pallet_weight = 0
340340
total_out_container_weight = 0
341-
out_movelines = objects.mapped("finished_move_line_ids")
341+
family_order = [
342+
"PECHUGA",
343+
"PECHUGA CON HUESO",
344+
"MUSLOS",
345+
"TRASEROS",
346+
"ALAS",
347+
"PIELES DESPIECE",
348+
"HUESOS DESPIECE",
349+
"CUELLOS DESPIECE",
350+
"MERMAS",
351+
]
352+
out_movelines = objects.mapped("finished_move_line_ids").sorted(
353+
key=lambda line: family_order.index(line.product_family_id.name)
354+
if line.product_family_id.name in family_order
355+
else 999
356+
)
342357
for line in out_movelines:
343358
if line.product_family_id not in categories:
344359
categories.append(line.product_family_id)

0 commit comments

Comments
 (0)