Commit 9e695da1 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Checkbox: handle stored value in relation field

parent 0bce4239
...@@ -11,18 +11,24 @@ ...@@ -11,18 +11,24 @@
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var field_json = options.field_json || {}, var field_json = options.field_json || {},
state_dict = { state_dict,
checked: asBoolean(getFirstNonEmpty(field_json.value, value;
field_json.default)), if (field_json.default === 'on') {
editable: field_json.editable, value = 1;
id: field_json.key, } else {
name: field_json.key, value = field_json.default;
title: field_json.title, }
hidden: field_json.hidden, state_dict = {
// Force calling subfield render checked: asBoolean(getFirstNonEmpty(field_json.value, value)),
// as user may have modified the input value editable: field_json.editable,
render_timestamp: new Date().getTime() id: field_json.key,
}; name: field_json.key,
title: field_json.title,
hidden: field_json.hidden,
// Force calling subfield render
// as user may have modified the input value
render_timestamp: new Date().getTime()
};
state_dict.text_content = state_dict.checked ? '' : ''; state_dict.text_content = state_dict.checked ? '' : '';
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>968.25417.15017.19182</string> </value> <value> <string>968.25795.35801.6843</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1529660724.7</float> <float>1529683518.67</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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