[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.
This commit is contained in:
Yannick Tivisse
2018-03-16 13:47:40 +01:00
parent f7501b9fff
commit 509679c3b6
@@ -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: