Skip to content

Commit

Permalink
[IMP] product_contract: contract quantity same quantity of order
Browse files Browse the repository at this point in the history
  • Loading branch information
jaenbox committed May 8, 2024
1 parent a87fbd0 commit f579c2f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions product_contract/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,13 @@ def onchange_date_start(self):
rec.date_end = rec._get_date_end() if rec.date_start else False

def _get_contract_line_qty(self):
"""Returns the quantity to be put on new contract lines."""
"""Returns the amount that will be placed in new contract lines."""
self.ensure_one()
# The quantity on the generated contract line is 1, as it
# correspond to the most common use cases:
# - quantity on the SO line = number of periods sold and unit
# price the price of one period, so the
# total amount of the SO corresponds to the planned value
# of the contract; in this case the quantity on the contract
# line must be 1
# - quantity on the SO line = number of hours sold,
# automatic invoicing of the actual hours through a variable
# quantity formula, in which case the quantity on the contract
# line is not used
# The quantity in the generated contract line is the quantity of
# product requested in the order, since they correspond to the most common
# use cases.
# Other use cases are easy to implement by overriding this method.
return 1.0
return self.product_uom_qty

def _prepare_contract_line_values(
self, contract, predecessor_contract_line_id=False
Expand Down

0 comments on commit f579c2f

Please sign in to comment.