[FIX] web: display contextual values in readonly domain

The domain component in readonly mode doesn't display dynamic/contextual
values.
For a domain `[('foo', '=', uid)]` the component displays "foo =" instead
of "foo = uid"

Part-of: odoo/odoo#127565
This commit is contained in:
Lucas Lefèvre (lul)
2023-07-06 17:52:42 +02:00
parent bbc0b10778
commit 82ec77def7
2 changed files with 8 additions and 1 deletions
@@ -154,7 +154,6 @@
<t t-foreach="values" t-as="value" t-key="value_index">
<span class="o_domain_leaf_value text-primary">
<t t-if="typeof value === 'string'"> "<t t-esc="value"/>"</t>
<t t-elif="isExprValue(value)"> <t t-esc="node.value.expr"/></t>
<t t-else=""> <t t-esc="value"/></t>
</span>
<t t-if="!value_last"> <t t-esc="connector" /> </t>
@@ -1397,4 +1397,12 @@ QUnit.module("Components", (hooks) => {
});
assert.strictEqual(getSelectedOperator(target), `not =?`);
});
QUnit.test("display of a contextual value (readonly)", async (assert) => {
await makeDomainSelector({
domain: `[("foo", "=", uid)]`,
readonly: true,
});
assert.strictEqual(target.querySelector(".o_domain_leaf").textContent, `Foo = uid`);
});
});