Hi Guys,
the goal is to customize a List View <tree> that changes the background colour of a specific cell if a Key/Value Pair is matched. So I tried to write my own template for the ListView in static/src/js and xml, which I copied out of the web module template, and add my own Javascript into my view_list.js, also from the web module, included my attf condition to the xml, added the paths to __openerp__.py
But now every List in OpenErp changes colors (css classes) so in Details:
got the ListView Template from /usr/lib/pymodules/python2.7/openerp/addons/web/static/src/xml/base.xml
<templates id="template" xml:space="preserve">
...
<table t-name="ListView" class="oe_list_content">
<t t-set="columns_count" t-value="visible_columns.length + (options.selectable ? 1 : 0) + (options.deletable ? 1 : 0)"/>`
...
and then to the :
<td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help" t-attf-class="oe_list_field_cell oe_list_field_#{column.widget or column.type} #{number ? 'oe_number' : ''} #{column.tag === 'button' ? 'oe-button' : ''} #{modifiers.readonly ? 'oe_readonly' : ''} #{modifiers.required ? 'oe_required' : ''}" t-att-data-field="column.id">
<t t-raw="render_cell(record, column)"/></td>
-added THIS -->>>
#{value_check(record.get(column.id), column.id) ? 'oe_custom_view' : 'oE_3o'}
The /addons/web/static/src/js/view_list.js is exactly the same but I added:
value_check: function (value, key) {
return ((key=="name") && (value=="test"));
},
so the condition can be matched.
So everything works so far but instead of only turning the cell colors of my module, every list view in open erp is changed.
Did I overwrote that by not changing the js or xml names and attributes?
How can I fix this so only my own view is affected?
ThX
Peter