[FIX] runbot: fix jsonb in list view

In view list widget are not always instanciated and a formater is used
instead. This means that the t-esc will try to output a jsonb field
without nowing how to render it, making the page crash.

This is quickly fixed by forcing the widget on the field in tree view.
This commit is contained in:
Xavier-Do 2023-06-26 13:36:20 +02:00
parent 96808acb37
commit 465081e9f3
2 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,7 @@ function stringify(obj) {
export class JsonField extends TextField {
static template = xml`
<t t-if="props.readonly">
<span t-esc="value" />
<span t-esc="value"/>
</t>
<t t-else="">
<div t-ref="div">
@ -37,7 +37,6 @@ export class JsonField extends TextField {
</t>
`;
setup() {
this.props.value.toString = () => stringify(this.props.value);
if (this.props.dynamicPlaceholder) {
this.dynamicPlaceholder = useDynamicPlaceholder();
}

View File

@ -106,7 +106,7 @@
<field name="trigger_id"/>
<field name="config_id"/>
<field name="extra_params"/>
<field name="config_data"/>
<field name="config_data" widget="jsonb"/>
</tree>
</field>
</record>