[IMP] hr_holidays: Improve Time Off activity summary

Currently, Dates displaying on activities of Time Off application are
not easy to read for users and We already have dates on the form with
the right user format. So we don't need it again on the chatter

So in this commit, we improve the activity summary message by
removing the dates from summary of activity.

closes odoo/odoo#60610

Taskid: 2339411
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Nisha patel
2021-01-21 13:13:24 +00:00
committed by Barad Mahendra
parent d524c48f2b
commit 7e0ff027d6
+1 -5
View File
@@ -1174,14 +1174,10 @@ class HolidaysRequest(models.Model):
def activity_update(self):
to_clean, to_do = self.env['hr.leave'], self.env['hr.leave']
for holiday in self:
start = UTC.localize(holiday.date_from).astimezone(timezone(holiday.employee_id.tz or 'UTC'))
end = UTC.localize(holiday.date_to).astimezone(timezone(holiday.employee_id.tz or 'UTC'))
note = _(
'New %(leave_type)s Request created by %(user)s from %(start)s to %(end)s',
'New %(leave_type)s Request created by %(user)s',
leave_type=holiday.holiday_status_id.name,
user=holiday.create_uid.name,
start=start,
end=end
)
if holiday.state == 'draft':
to_clean |= holiday