Commit 19230100 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: improve code to select key and value properly

parent cf3cf259
...@@ -27,12 +27,20 @@ ...@@ -27,12 +27,20 @@
}); });
}) })
.declareMethod('getSearchCriteria', function (a, b) { .declareMethod('getSearchCriteria', function (a, b) {
var key, value;
if (this.state.extended_search_mapping.hasOwnProperty(b)) {
key = this.state.extended_search_mapping[b].value;
value = a;
} else {
key = this.state.extended_search_mapping[a].key;
value = this.state.extended_search_mapping[a].value;
}
return Query.objectToSearchText( return Query.objectToSearchText(
new SimpleQuery({ new SimpleQuery({
operator: "", operator: "",
key: this.state.extended_search_mapping[b].value, key: key,
type: "simple", type: "simple",
value: a value: value
}) })
); );
}) })
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>997.10234.48008.57565</string> </value> <value> <string>997.10483.47677.43724</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1640795301.35</float> <float>1640812793.85</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