diff --git a/contract_variable_quantity/__manifest__.py b/contract_variable_quantity/__manifest__.py index de10a337..325b64a4 100644 --- a/contract_variable_quantity/__manifest__.py +++ b/contract_variable_quantity/__manifest__.py @@ -1,10 +1,10 @@ -# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2016-2018 Tecnativa - Pedro M. Baeza # Copyright 2018 Tecnativa - Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Variable quantity in contract recurrent invoicing', - 'version': '11.0.1.2.0', + 'version': '11.0.1.2.1', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "Tecnativa," diff --git a/contract_variable_quantity/models/contract.py b/contract_variable_quantity/models/contract.py index d4de2a6c..1d25df93 100644 --- a/contract_variable_quantity/models/contract.py +++ b/contract_variable_quantity/models/contract.py @@ -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