summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-01-19 15:53:01 +0100
committerqsm-odoo <qsm@odoo.com>2017-01-31 11:38:52 +0100
commit495b5ef1172ff9b477c2ebf9afb9ad8d2ca2e989 (patch)
treef0e420854cfb417f796989c2941af3107084487f /addons/web/static/src/xml
parent3c452a2ecd73c1f6d739fd4d8db1f5f6313fd752 (diff)
[IMP] web: add options to field selector to filter the fields
Before this commit, the field selector had an unique option to filter the fields it displays: filters.searchable, which tells the widget to only display the searchable fields (which is the default). Now there are two more options: - fields: an explicit list of the fields to use (if null, let the widget get the fields itself (this is the default)) - followRelations: a boolean which is true if the user can follow relation to build a field chain (default to true) These options are needed by Web Studio in enterprise where domain construction for form view attrs can only use fields which are in the view and do not follow relations.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml18
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 8abdf9160ed..9e38841b946 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -802,7 +802,7 @@
</div>
<div t-name="FieldSelector" class="o_field_selector">
- <input type="text" t-att-value="widget.chain" t-att-readonly="!(widget.debug) and 1 or None"/>
+ <input type="text" t-att-value="widget.chain" t-att-readonly="!(widget.options.debugMode) and 1 or None"/>
<div class="o_field_selector_controls">
<i class="fa fa-exclamation-triangle o_field_selector_warning hidden" title="Invalid field chain"/>
</div>
@@ -818,13 +818,15 @@
</div>
</div>
<ul t-name="FieldSelector.page" t-attf-class="o_field_selector_page #{animation}">
- <li t-foreach="lines" t-as="line"
- t-attf-class="o_field_selector_item #{line.relation and 'o_field_selector_next_page' or 'o_field_selector_select_button'}#{line_index == 0 and ' active' or ''}"
- t-att-data-name="line.name">
- <t t-esc="line.string"/>
- <div t-if="debug" class="text-muted o_field_selector_item_title"><t t-esc="line.name"/> (<t t-esc="line.type"/>)</div>
- <i t-if="line.relation" class="fa fa-chevron-right o_field_selector_relation_icon" t-att-data-name="line.name"/>
- </li>
+ <t t-foreach="lines" t-as="line">
+ <t t-set="relationToFollow" t-value="followRelations &amp;&amp; line.relation"/>
+ <li t-attf-class="o_field_selector_item #{relationToFollow and 'o_field_selector_next_page' or 'o_field_selector_select_button'}#{line_index == 0 and ' active' or ''}"
+ t-att-data-name="line.name">
+ <t t-esc="line.string"/>
+ <div t-if="debug" class="text-muted o_field_selector_item_title"><t t-esc="line.name"/> (<t t-esc="line.type"/>)</div>
+ <i t-if="relationToFollow" class="fa fa-chevron-right o_field_selector_relation_icon"/>
+ </li>
+ </t>
</ul>
<t t-name="web.datepicker">