Skip to content

Commit

Permalink
[14.0][IMP] custom_mrp_descarga: Change grouping.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu Nombre authored and anajuaristi committed Sep 17, 2024
1 parent c00d658 commit 67ceacd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions custom_mrp_descarga/views/mrp_production_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@
<field name="consume_qty" optional="show" sum="Total Consumed" />
<field name="produced_qty" optional="show" sum="Total Produced" />
<field name="qty_difference" optional="show" />
<field name="entry_total_amount" optional="show" />
<field name="output_total_amount" optional="show" />
<field name="dif_total_amount" optional="show" />
<field name="asphyxiation_units" optional="show" />
<field name="seized_units" optional="show" />
<field name="birth_rate" optional="show" />
Expand Down Expand Up @@ -719,8 +722,10 @@
<field name="purchase_unit_price" optional="show" />
<field name="asphyxiation_units" optional="show" />
<field name="seized_units" optional="show" />
<field name="purchase_price" optional="show" />
<field name="cost" optional="show" />
<field name="entry_total_amount" optional="show" />
<field name="dif_total_amount" optional="show" />
<field
name="state"
optional="show"
Expand Down

0 comments on commit 67ceacd

Please sign in to comment.