[FIX] hr_timesheet_sheet: Display warning in user's language

Closes https://github.com/odoo/odoo/pull/17254/files
This commit is contained in:
Yenthe V.G
2017-05-29 11:28:42 +02:00
committed by Yannick Tivisse
parent 5c0355c033
commit 5e652c856d
2 changed files with 8 additions and 1 deletions
@@ -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
@@ -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):