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

project: fix injecting error messages from action script

This uses an internal API that has changed in 0aeea3c4 (Validation
message translation, 2021-01-06)
parent 940f40ce
......@@ -7,7 +7,7 @@ portal = context.getPortalObject()
line_portal_type = "Sale Order Line"
request = context.REQUEST
from string import zfill
from Products.ERP5Type.Document import newTempBase
from Products.PythonScripts.standard import Object
from Products.ERP5Type.Message import translateString
context.log('original listbox', listbox)
......@@ -65,9 +65,12 @@ for line in line_list:
else:
line_dict['source_project_relative_url'] = result[0].getRelativeUrl()
if error_message:
error = newTempBase(context, key)
error.edit(error_text=error_message)
validation_errors['listbox_source_project_title_new_%s' % key] = error
validation_errors['listbox_source_project_title_new_%s' % key] = Object(
field_id='listbox_source_project_title_new_%s' % key,
getMessage=lambda translateString: translateString(error_message),
)
)
listbox.append(line_dict)
i += 1
......
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