[FIX] l10n_be_hr_payroll_fleet: clean mismatched values

Between 11.0 and master there was a mismatch in the legal values used to
compute the co2 fee and the ATN of a company car.

Task : 1937082

closes odoo/odoo#30841
This commit is contained in:
sed-odoo
2019-02-05 15:36:54 +00:00
committed by RomainLibert
parent 88e76a7ff1
commit ec42737702
@@ -46,10 +46,10 @@ class FleetVehicle(models.Model):
car.total_cost += contract.cost_generated / 12.0
def _get_co2_fee(self, co2, fuel_type):
fuel_coefficient = {'diesel': 600, 'gasoline': 768, 'lpg': 990, 'electric': 0, 'hybrid': 0}
fuel_coefficient = {'diesel': 600, 'gasoline': 768, 'lpg': 990, 'electric': 0, 'hybrid': 600}
co2_fee = 26.47
if fuel_type and fuel_type not in ['electric', 'hybrid']:
co2_fee = (((co2 * 9.0) - fuel_coefficient.get(fuel_type)) * 1.2488) / 12.0
co2_fee = (((co2 * 9.0) - fuel_coefficient.get(fuel_type)) * 144.97 / 114.08) / 12.0
return max(co2_fee , 26.47)
@api.depends('co2', 'fuel_type')
@@ -117,7 +117,7 @@ class FleetVehicle(models.Model):
if fuel_type in ['diesel', 'hybrid']:
reference = 86.0
else:
reference = 105.0
reference = 88.0
if co2 <= reference:
atn = car_value * max(0.04, (0.055 - 0.001 * (reference - co2))) * magic_coeff