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

[erp5_web_renderjs_ui] Checkbox: handle stored value in relation field

parent 0bce4239
...@@ -11,9 +11,15 @@ ...@@ -11,9 +11,15 @@
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var field_json = options.field_json || {}, var field_json = options.field_json || {},
state_dict,
value;
if (field_json.default === 'on') {
value = 1;
} else {
value = field_json.default;
}
state_dict = { state_dict = {
checked: asBoolean(getFirstNonEmpty(field_json.value, checked: asBoolean(getFirstNonEmpty(field_json.value, value)),
field_json.default)),
editable: field_json.editable, editable: field_json.editable,
id: field_json.key, id: field_json.key,
name: field_json.key, name: field_json.key,
......
...@@ -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