[FIX] l10n_be_hr_payroll_fleet: fallback for no language
If the context is lang=None, it crashed as called babel with a None locale. Closes #18403 opw-756026
This commit is contained in:
@@ -69,7 +69,7 @@ class FleetVehicle(models.Model):
|
||||
return babel.dates.format_date(
|
||||
date=Datetime.from_string(self.acquisition_date),
|
||||
format='MMMM y',
|
||||
locale=self._context.get('lang', 'en_US')
|
||||
locale=self._context.get('lang') or 'en_US'
|
||||
)
|
||||
|
||||
def _get_car_atn(self, acquisition_date, car_value, fuel_type, co2):
|
||||
|
||||
Reference in New Issue
Block a user