Commit 1f07aaee authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add a hack to work around a bug that CheckBoxField may not even try to get a...

Add a hack to work around a bug that CheckBoxField may not even try to get a property value, because it has a default value 0 in the field definition itself. The same hack was performed against Form.py but this has been disabled mistakenly for a while, because monkey-patched methods were overridden in ProxyField.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38432 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80e9c963
......@@ -52,7 +52,8 @@ from Acquisition import aq_base, aq_inner, aq_acquire, aq_chain
from Products.ERP5Type.Globals import DTMLFile
from Products.Formulator.TALESField import TALESMethod
from Products.ERP5Form.Form import StaticValue, TALESValue, OverrideValue, DefaultValue, EditableValue
from Products.ERP5Form.Form import StaticValue, TALESValue, OverrideValue, \
DefaultValue, EditableValue, DefaultCheckBoxValue
from Products.ERP5Form.Form import copyMethod, isCacheable
from Products.CMFCore.Skinnable import SKINDATA
......@@ -682,6 +683,9 @@ class ProxyField(ZMIField):
cacheable = isCacheable(value)
if id == 'default' and field_id.startswith('my_'):
# XXX far from object-oriented programming
if template_field.meta_type == 'CheckBoxField':
return DefaultCheckBoxValue(field_id, value), cacheable
return DefaultValue(field_id, value), cacheable
# For the 'editable' value, we try to get a default value
......
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