mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract_variable_quantity: Recompute price when changing qty
If you have contract lines with automatic price and your pricelist contains different prices per quantity, the price is not changed when computing quantity. This PR fixes this.
This commit is contained in:
committed by
Carolina Fernandez
parent
7b83ca7656
commit
fa336d01a8
@@ -38,6 +38,10 @@ class AccountAnalyticAccount(models.Model):
|
||||
vals = {}
|
||||
else:
|
||||
vals['quantity'] = qty
|
||||
# Re-evaluate price with this new quantity
|
||||
vals['price_unit'] = line.with_context(
|
||||
contract_line_qty=qty,
|
||||
).price_unit
|
||||
return vals
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user