Skip to content

Commit

Permalink
[FIX]product_replenishment_cost_mrp:quick fix v15
Browse files Browse the repository at this point in the history
X-original-commit: f698643
  • Loading branch information
jcadhoc committed May 6, 2024
1 parent a4d492a commit 131fe13
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions product_replenishment_cost_mrp/report/mrp_report_bom_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _get_component_data(self, parent_bom, warehouse, bom_line, line_quantity, le
})
return res

<<<<<<< HEAD
@api.model
def _get_byproducts_lines(self, product, bom, bom_quantity, level, total, index):
byproducts, byproduct_cost_portion = super()._get_byproducts_lines(product, bom, bom_quantity, level, total, index)
Expand All @@ -63,6 +64,37 @@ def _get_byproducts_lines(self, product, bom, bom_quantity, level, total, index)
'prod_cost': price,
})
return byproducts, byproduct_cost_portion
||||||| parent of 26dc8132 (temp)
def _get_price(self, bom, factor, product):
price = 0
if bom.routing_id:
# routing are defined on a BoM and don't have a concept of quantity.
# It means that the operation time are defined for the quantity on
# the BoM (the user produces a batch of products). E.g the user
# product a batch of 10 units with a 5 minutes operation, the time
# will be the 5 for a quantity between 1-10, then doubled for
# 11-20,...
operation_cycle = float_round(
factor, precision_rounding=1, rounding_method='UP')
operations = self._get_operation_line(
bom.routing_id, operation_cycle, 0)
price += sum([op['total'] for op in operations])
=======
def _get_price(self, bom, factor, product):
price = 0
if bom.operation_ids:
# routing are defined on a BoM and don't have a concept of quantity.
# It means that the operation time are defined for the quantity on
# the BoM (the user produces a batch of products). E.g the user
# product a batch of 10 units with a 5 minutes operation, the time
# will be the 5 for a quantity between 1-10, then doubled for
# 11-20,...
operation_cycle = float_round(
factor, precision_rounding=1, rounding_method='UP')
operations = self._get_operation_line(
bom.operation_ids, operation_cycle, 0)
price += sum([op['total'] for op in operations])
>>>>>>> 26dc8132 (temp)

@api.model
def _get_operation_line(self, product, bom, qty, level, index):
Expand Down

0 comments on commit 131fe13

Please sign in to comment.