forked from Techsystech/web
[IMP][web_widget_auto_color] Replace widget by simple autocolor attribute
parent
79fd6b76de
commit
edbefd1305
|
@ -4,9 +4,9 @@
|
|||
Web Widget Auto Color
|
||||
=====================
|
||||
|
||||
This module was written to offer a new autocolor widget which can be used on
|
||||
field in trees view. Using this widget causes an identical coloration for cells
|
||||
of the same value in a list view.
|
||||
This module was written to offer a new autocolor attribute which can be used on
|
||||
field in trees view. Using this attribute causes an identical coloration for
|
||||
cells of the same value in a list view.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
@ -18,14 +18,14 @@ To install this module, you need to:
|
|||
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">
|
||||
<tree string="View name">
|
||||
...
|
||||
<field name="name"/>
|
||||
<field name="name" widget="autocolor"/>
|
||||
<field name="name2" autocolor="1"/>
|
||||
...
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
@ -54,8 +54,4 @@ openerp.web_widget_auto_color = function(instance) {
|
|||
return style
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
instance.web.form.widgets.add('autocolor', 'instance.web.form.AbstractField');
|
||||
|
||||
};
|
|
@ -2,7 +2,7 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<tr t-extend="ListView.row">
|
||||
<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>
|
||||
</tr>
|
||||
</templates>
|
||||
|
|
Loading…
Reference in New Issue