[FIX] hr: do not translate contrains at load time
The _constaints definition is done at server load, not when a user is triggering the check. The constrains are already translated, no need to try translating it again.
This commit is contained in:
+2
-2
@@ -261,7 +261,7 @@ class hr_employee(osv.osv):
|
||||
user_field_lst.append(name)
|
||||
return user_field_lst
|
||||
|
||||
_constraints = [(osv.osv._check_recursion, _('Error! You cannot create recursive hierarchy of Employee(s).'), ['parent_id']),]
|
||||
_constraints = [(osv.osv._check_recursion, 'Error! You cannot create recursive hierarchy of Employee(s).', ['parent_id']),]
|
||||
|
||||
|
||||
class hr_department(osv.osv):
|
||||
@@ -291,7 +291,7 @@ class hr_department(osv.osv):
|
||||
}
|
||||
|
||||
_constraints = [
|
||||
(osv.osv._check_recursion, _('Error! You cannot create recursive departments.'), ['parent_id'])
|
||||
(osv.osv._check_recursion, 'Error! You cannot create recursive departments.', ['parent_id'])
|
||||
]
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -421,16 +421,12 @@ msgid "Employees Tags"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr
|
||||
#: code:addons/hr/hr.py:299
|
||||
#: constraint:hr.department:0
|
||||
#, python-format
|
||||
msgid "Error! You cannot create recursive departments."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr
|
||||
#: code:addons/hr/hr.py:269
|
||||
#: constraint:hr.employee:0
|
||||
#, python-format
|
||||
msgid "Error! You cannot create recursive hierarchy of Employee(s)."
|
||||
msgstr ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user