Commit 7943ac16 authored by Julien Muchembled's avatar Julien Muchembled

Do not keep entered values for editable listbox cells without uid

Without this, every rendered cells would contain the concatenation of all cells
with same uid (i.e. None) in the previous page, and the size of each cell would
increase exponentially at each update.
parent 0ca19b85
......@@ -2445,12 +2445,17 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
pass
if editable_field is not None:
# XXX what if the object does not have uid?
key = '%s_%s' % (editable_field.getId(), self.getUid())
uid = self.getUid()
key = '%s_%s' % (editable_field.getId(), uid)
if sql in editable_column_id_set:
listbox_defines_column_as_editable = True
if uid is None:
display_value = original_value
else:
# Like any other field in ERP5, always use the value entered by the
# user if any. This duplicates some work done by field.render
# user if any. However, it's only possible if keys are unique,
# so this is skipped if there's no uid.
# This duplicates some work done by field.render
try:
display_value = editable_field._get_user_input_value(
editable_field.generate_field_key(key=key), request)
......
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