diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-03-08 16:43:44 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 29cd7154e66a30fb656b88e16b4301d17fa7d958 (patch) | |
| tree | 4f1adf4c812aa38a1a9029c4e13d0beac26b45ee /addons/web/static/src/xml/base.xml | |
| parent | b5b649e5b21d41279f12f0dbe6cfa53ca2c52580 (diff) | |
[FIX] web: restore FieldStatus behavior
FieldStatus was broken:
- With a selection, the statusbar_visible attribute forces the choices
to display, the discarded ones do not appear at all (even folded)
- With a m2o, the fold_field option tells the field to check in the
relation to know if the choice has to be folded or not, this was not
properly supported
- Changing a m2o value was broken as the parseMany2one function did
not exist
- The status were misordered
- ...
* Also refactor the way the rendering is handled.
* Also modify all statusbar tests so that the statusbar widget is
placed in the form header tag (as it is the common use case).
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1f95503441a..3976a41d783 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -926,13 +926,7 @@ <span t-if="widget.string"><t t-esc="widget.string"/></span> </div> </t> -<t t-name="FieldStatus"> - <ul class="o_statusbar_status" t-att-style="widget.attrs.style"/> -</t> <t t-name="FieldStatus.content.desktop"> - <t t-foreach="selection_unfolded" t-as="i"> - <t t-call="FieldStatus.content.button"/> - </t> <t t-if="selection_folded.length"> <ul class="dropdown-menu o-status-more" role="menu"> <li t-foreach="selection_folded" t-as="i"> @@ -941,27 +935,24 @@ </ul> <button type="button" class="btn btn-sm o_arrow_button btn-default dropdown-toggle" data-toggle="dropdown">More <span class="caret"/></button> </t> + <t t-foreach="selection_unfolded.reverse()" t-as="i"> + <t t-call="FieldStatus.content.button"/> + </t> </t> <t t-name="FieldStatus.content.mobile"> <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown"> - <t t-foreach="selection_unfolded" t-as="i"> - <t t-if="i.id === value"> - <t t-esc="i.display_name"/> - </t> - </t> + <t t-esc="value"/> </button> <ul class="dropdown-menu o-status-more" role="menu"> - <li t-foreach="selection_unfolded" t-as="i"> - <t t-call="FieldStatus.content.button"/> - </li> - <li t-foreach="selection_folded" t-as="i"> + <li t-foreach="selection" t-as="i"> <t t-call="FieldStatus.content.button"/> </li> </ul> </t> <t t-name="FieldStatus.content.button"> - <button type="button" t-att-data-value="i.id" - t-attf-class="btn btn-sm o_arrow_button #{i.selected ? 'btn-primary disabled' : 'btn-default'} #{!clickable ? 'disabled' : ''}"> + <t t-set="disabled" t-value="!clickable || i.selected"/> + <button type="button" t-att-data-value="i.id" t-att-disabled="disabled ? 'disabled' : undefined" + t-attf-class="btn btn-sm o_arrow_button btn-#{i.selected ? 'primary' : 'default'}#{disabled ? ' disabled' : ''}"> <t t-esc="i.display_name"/> </button> </t> |
