From a3a45e18b3bf861de4f6b84892f2930dfb7c94b7 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 6 Oct 2011 08:39:49 +0200 Subject: [FIX] m2o fields with selection widget in search view Plan was originally to just ignore this because "it should just work" but turns out m2o and m2o[@widget=selection] fields have very different behaviors when it comes to default values, especially custom domains and contexts: * An m2o field uses its string value always (behaves like a char field), for UI and clarity purposes we added an [[name, '=', id]] case when the user specifically selects an autocompletion value, but that's not "cannon", when it comes to dealing with custom domains (filter_domain) and contexts the field always uses its string value. * An m2o[@widget=selection] field on the other hand uses its ids always (behaves like a selection field). That's not entirely true, really, because it has the converse to what we implemented on the m2o field in the web client (in the GTK client): if there is no @filter_domain *and* the user has entered a value which is not in the dropdown (it's a combobox in the GTK client), then it falls back on using 'ilike'. This string value is *not* used in custom domains and custom filters, which simply are not submitted. This second section has *not* been implemented so far in the web client, we'll come round to it if people actually need it. bzr revid: xmo@openerp.com-20111006063949-fl5rbg3wwubcaay8 --- addons/web/static/src/xml/base.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/xml/base.xml') diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f8519c1dfaf..a66ad59f9a5 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1092,7 +1092,7 @@
@@ -775,7 +775,7 @@
@@ -814,7 +814,7 @@ @@ -833,8 +833,8 @@ -
- +
+ @@ -886,8 +887,8 @@ + t-att-id="widget.element_id" + t-attf-class="field_#{widget.type}"/>
@@ -902,7 +903,7 @@ t-att-border="widget.readonly ? 0 : 1" t-att-id="widget.element_id + '_field'" t-att-name="widget.name" - t-attf-class="field_#{widget.type} #{widget.element_class}" + t-attf-class="field_#{widget.type}" t-att-width="widget.node.attrs.img_width || widget.node.attrs.width" t-att-height="widget.node.attrs.img_height || widget.node.attrs.height" /> @@ -950,7 +951,7 @@ @@ -995,7 +996,6 @@