From 509679c3b6e0eaf103dccc46fd9abf06fd684a00 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 16 Mar 2018 13:42:59 +0100 Subject: [PATCH] [FIX] l10n_be_hr_payroll: Compute car atn and costs correctly on new cars If the contract is misconfigured (A car and a new car is set), then compute correctly the costs. --- addons/l10n_be_hr_payroll_fleet/models/hr_contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py b/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py index f774eaa0436..a6a3c10ac13 100644 --- a/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py +++ b/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py @@ -21,7 +21,7 @@ class HrContract(models.Model): @api.depends('car_id', 'new_car', 'new_car_model_id') def _compute_car_atn_and_costs(self): for contract in self: - if contract.car_id: + if not contract.new_car and contract.car_id: contract.car_atn = contract.car_id.atn contract.company_car_total_depreciated_cost = contract.car_id.total_depreciated_cost elif contract.new_car and contract.new_car_model_id: