[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:
Martin Trigaux
2016-08-08 12:01:56 +02:00
parent a1fbb3d389
commit b5d550d7b0
2 changed files with 2 additions and 6 deletions
+2 -2
View File
@@ -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):
-4
View File
@@ -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 ""