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 @@
.declareMethod('render', function (options) {
var field_json = options.field_json || {},
state_dict = {
checked: asBoolean(getFirstNonEmpty(field_json.value,
field_json.default)),
editable: field_json.editable,
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,
value;
if (field_json.default === 'on') {
value = 1;
} else {
value = field_json.default;
}
state_dict = {
checked: asBoolean(getFirstNonEmpty(field_json.value, value)),
editable: field_json.editable,
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 ? '' : '';
return this.changeState(state_dict);
})
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.25417.15017.19182</string> </value>
<value> <string>968.25795.35801.6843</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1529660724.7</float>
<float>1529683518.67</float>
<string>UTC</string>
</tuple>
</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