From b5d550d7b058af616bf81ebd7c2c1abf8821c288 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 8 Aug 2016 11:57:24 +0200 Subject: [PATCH] [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. --- addons/hr/hr.py | 4 ++-- addons/hr/i18n/hr.pot | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 0517dacdf11..e87ae89af24 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -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): diff --git a/addons/hr/i18n/hr.pot b/addons/hr/i18n/hr.pot index dfdcb92a3d8..2d8f3c32d03 100644 --- a/addons/hr/i18n/hr.pot +++ b/addons/hr/i18n/hr.pot @@ -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 ""