mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract_price_revision: Improve compatibility with contract base module
Values for new line should come from _prepare_value_for_plan_successor function adding the new price.
This commit is contained in:
@@ -47,3 +47,16 @@ class ContractLine(models.Model):
|
||||
) * 100
|
||||
else:
|
||||
line.variation_percent = 0.0
|
||||
|
||||
def _prepare_value_for_plan_successor_price(
|
||||
self, date_start, date_end, is_auto_renew, price, recurring_next_date=False
|
||||
):
|
||||
"""
|
||||
Override contract function to prepare values for new contract line
|
||||
adding the new price as parameter
|
||||
"""
|
||||
res = super()._prepare_value_for_plan_successor(
|
||||
date_start, date_end, is_auto_renew, recurring_next_date=recurring_next_date
|
||||
)
|
||||
res.update({"price_unit": price})
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user