Commit a1bb5219 authored by Guillaume Michon's avatar Guillaume Michon

Added an argument to _checkImmobilisationConsistency to make future translation easier.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6063 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8da579d5
...@@ -104,7 +104,10 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -104,7 +104,10 @@ class ImmobilisationMovement(Movement, XMLObject):
) )
def _checkImmobilisationConsistency(self, fixit=0, mapped_value_property_list=()): def _checkImmobilisationConsistency(self, fixit=0, mapped_value_property_list=(), to_translate=1):
"""
If to_translate is set, the method may return a dictionary {'msg':'...', 'mapping':{} }
"""
relative_url = self.getRelativeUrl() relative_url = self.getRelativeUrl()
def checkValuesAreNotNone(property_list): def checkValuesAreNotNone(property_list):
...@@ -159,9 +162,16 @@ class ImmobilisationMovement(Movement, XMLObject): ...@@ -159,9 +162,16 @@ class ImmobilisationMovement(Movement, XMLObject):
error_found = 1 error_found = 1
date_error = 1 date_error = 1
if error_found: if error_found:
if to_translate:
msg = {'msg':"An other movement already exists at the same date for item ${item}",
'mapping': {'item':item.getRelativeUrl()}
}
else:
msg = "An other movement alreay exists at the same date for item %s" % item.getRelativeUrl()
errors.append([self.getRelativeUrl(), errors.append([self.getRelativeUrl(),
"Property value inconsistency", 0, "Property value inconsistency", 0,
"An other movement already exists at the same date for item %s" % item.getRelativeUrl()]) msg
])
# Return to avoid infinite loops in case of date errors # Return to avoid infinite loops in case of date errors
if date_error: if date_error:
......
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