From 5e652c856da4e4b627344c854b41886526da268a Mon Sep 17 00:00:00 2001 From: "Yenthe V.G" Date: Mon, 29 May 2017 09:08:44 +0200 Subject: [PATCH] [FIX] hr_timesheet_sheet: Display warning in user's language Closes https://github.com/odoo/odoo/pull/17254/files --- addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot | 7 +++++++ addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot b/addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot index ff96a97cda0..415249f1248 100644 --- a/addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot +++ b/addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot @@ -466,6 +466,13 @@ msgstr "" msgid "You cannot duplicate a timesheet." msgstr "" +#. module: hr_timesheet_sheet +#: code:addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py:85 +#, python-format +msgid "You cannot have 2 timesheets that overlap!\n" +"Please use the menu 'My Current Timesheet' to avoid this problem." +msgstr "" + #. module: hr_timesheet_sheet #: code:addons/hr_timesheet_sheet/models/account_analytic_line.py:60 #, python-format diff --git a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py index f017760e070..62f4685a84b 100644 --- a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py @@ -85,7 +85,7 @@ class HrTimesheetSheet(models.Model): AND id <> %s''', (sheet.date_to, sheet.date_from, new_user_id, sheet.id)) if any(self.env.cr.fetchall()): - raise ValidationError('You cannot have 2 timesheets that overlap!\nPlease use the menu \'My Current Timesheet\' to avoid this problem.') + raise ValidationError(_('You cannot have 2 timesheets that overlap!\nPlease use the menu \'My Current Timesheet\' to avoid this problem.')) @api.onchange('employee_id') def onchange_employee_id(self):