Commit cbb7b138 authored by Jérome Perrin's avatar Jérome Perrin

use new style user configurable messages.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18365 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0378a3ac
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
from Products.ERP5Type.Constraint import Constraint from Products.ERP5Type.Constraint import Constraint
from Products.ERP5Type.Message import Message from Products.ERP5Type.Message import Message
N_ = lambda msg: msg N_ = lambda msg: msg # just to extract messages
_MARKER = [] _MARKER = []
class AccountTypeConstraint(Constraint): class AccountTypeConstraint(Constraint):
...@@ -50,6 +50,12 @@ class AccountTypeConstraint(Constraint): ...@@ -50,6 +50,12 @@ class AccountTypeConstraint(Constraint):
This constraints supports fixing consistency. This constraints supports fixing consistency.
""" """
_message_id_list = ['message_inconsistent_account_type']
message_inconsistent_account_type = N_('Account is member'\
' of ${category}, this should have account_type'\
' in ${account_type_list}')
def checkConsistency(self, obj, fixit=0): def checkConsistency(self, obj, fixit=0):
"""Implement here the consistency checker """Implement here the consistency checker
...@@ -68,8 +74,7 @@ class AccountTypeConstraint(Constraint): ...@@ -68,8 +74,7 @@ class AccountTypeConstraint(Constraint):
if obj.isMemberOf(category): if obj.isMemberOf(category):
if obj.getAccountType() not in account_type_list: if obj.getAccountType() not in account_type_list:
errors.append(self._generateError(obj, errors.append(self._generateError(obj,
N_("Account is member of ${category}, thus should have" self._getMessage('message_inconsistent_account_type'),
" account_type in ${account_type_list}"),
# XXX we should probably print translated logical path of # XXX we should probably print translated logical path of
# categories instead of category path. # categories instead of category path.
mapping=dict(category=category, mapping=dict(category=category,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment