[FIX] hr_holidays: use the language format to display dates

Steps to reproduce:
- go to Time Off app.

Issue:
Dates in the dashboard do not respect the language format.

Cause:
We give a date format to the `format_date` function.
This function applies this format and not the language format.

opw-3138369

closes odoo/odoo#111130

X-original-commit: 432f146884d0a8b302b8f322f775087da027152b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
This commit is contained in:
Thomas Lefebvre (thle)
2023-01-27 07:18:00 +01:00
parent 31463afc8c
commit a3e6b5caae
+1 -1
View File
@@ -442,7 +442,7 @@ class HolidaysType(models.Model):
'leaves_requested': ('%.2f' % (self.max_leaves - self.virtual_remaining_leaves - self.leaves_taken)).rstrip('0').rstrip('.'),
'leaves_approved': ('%.2f' % self.leaves_taken).rstrip('0').rstrip('.'),
'closest_allocation_remaining': ('%.2f' % closest_allocation_remaining).rstrip('0').rstrip('.'),
'closest_allocation_expire': format_date(self.env, self.closest_allocation_to_expire.date_to, date_format="MM/dd/yyyy") if self.closest_allocation_to_expire.date_to else False,
'closest_allocation_expire': format_date(self.env, self.closest_allocation_to_expire.date_to) if self.closest_allocation_to_expire.date_to else False,
'request_unit': self.request_unit,
'icon': self.sudo().icon_id.url,
}, self.requires_allocation, self.id)