Skip to content

Commit

Permalink
[FIX] hr_timesheet_sheet: Display warning in user's language
Browse files Browse the repository at this point in the history
  • Loading branch information
Yenthe666 authored and tivisse committed May 29, 2017
1 parent 5c0355c commit 5e652c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions addons/hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _check_sheet_date(self, forced_user_id=False):
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):
Expand Down

0 comments on commit 5e652c8

Please sign in to comment.