[IMP] hr_timesheet: change task name_get

Remove superfluous dash in `project.task name_get` and replace it with
nbsp to be able to split on that specific value in a similar manner as
before.

Closes odoo/odoo#74350

Task ID: 2596229

Related: odoo/enterprise#19916
Related: odoo/upgrade#2705
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
William Braeckman
2021-08-30 08:36:51 +00:00
parent bf77ba0f40
commit 39636ea698
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -282,7 +282,7 @@ class Task(models.Model):
for task in self:
if task.allow_timesheets and task.planned_hours > 0 and task.encode_uom_in_days:
days_left = _("(%s days remaining)") % task._convert_hours_to_days(task.remaining_hours)
name_mapping[task.id] = name_mapping.get(task.id, '') + " ‒ " + days_left
name_mapping[task.id] = name_mapping.get(task.id, '') + u"\u00A0" + days_left
elif task.allow_timesheets and task.planned_hours > 0:
hours, mins = (str(int(duration)).rjust(2, '0') for duration in divmod(abs(task.remaining_hours) * 60, 60))
hours_left = _(
@@ -291,7 +291,7 @@ class Task(models.Model):
hours=hours,
minutes=mins,
)
name_mapping[task.id] = name_mapping.get(task.id, '') + " ‒ " + hours_left
name_mapping[task.id] = name_mapping.get(task.id, '') + u"\u00A0" + hours_left
return list(name_mapping.items())
return super().name_get()
@@ -17,7 +17,7 @@ const TaskWithHours = FieldMany2One.extend({
* @override
*/
_getDisplayNameWithoutHours: function (value) {
return value && value.split(' ‒ ')[0];
return value && value.split('\u00A0')[0];
},
/**
* @override