mirror of https://github.com/OCA/web.git
[IMP][web_widget_auto_color] Replace widget by simple autocolor attribute
parent
79fd6b76de
commit
edbefd1305
|
@ -4,9 +4,9 @@
|
||||||
Web Widget Auto Color
|
Web Widget Auto Color
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
This module was written to offer a new autocolor widget which can be used on
|
This module was written to offer a new autocolor attribute which can be used on
|
||||||
field in trees view. Using this widget causes an identical coloration for cells
|
field in trees view. Using this attribute causes an identical coloration for
|
||||||
of the same value in a list view.
|
cells of the same value in a list view.
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
|
@ -18,14 +18,14 @@ To install this module, you need to:
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
In the view declaration, put widget='autocolor' attribute in the field tag::
|
In the view declaration, put autocolor="1" attribute in the field tag::
|
||||||
|
|
||||||
...
|
...
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="View name">
|
<tree string="View name">
|
||||||
...
|
...
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="name" widget="autocolor"/>
|
<field name="name2" autocolor="1"/>
|
||||||
...
|
...
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|
|
@ -54,8 +54,4 @@ openerp.web_widget_auto_color = function(instance) {
|
||||||
return style
|
return style
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
instance.web.form.widgets.add('autocolor', 'instance.web.form.AbstractField');
|
|
||||||
|
|
||||||
};
|
};
|
|
@ -2,7 +2,7 @@
|
||||||
<templates id="template" xml:space="preserve">
|
<templates id="template" xml:space="preserve">
|
||||||
<tr t-extend="ListView.row">
|
<tr t-extend="ListView.row">
|
||||||
<t t-jquery="td[t-att-data-field='column.id']">
|
<t t-jquery="td[t-att-data-field='column.id']">
|
||||||
this.attr('t-att-style', "column.widget =='autocolor' and view.auto_color_cell_style(render_cell(record, column))")
|
this.attr('t-att-style', "column.autocolor == '1' and view.auto_color_cell_style(render_cell(record, column), column)")
|
||||||
</t>
|
</t>
|
||||||
</tr>
|
</tr>
|
||||||
</templates>
|
</templates>
|
||||||
|
|
Loading…
Reference in New Issue