Browse Source

[RFR] delete unused code, move files to standard locations

pull/331/head
Holger Brunn 9 years ago
parent
commit
5008934c5c
  1. 2
      web_tree_dynamic_colored_field/__openerp__.py
  2. 37
      web_tree_dynamic_colored_field/static/src/js/web_tree_dynamic_colored_field.js
  3. 2
      web_tree_dynamic_colored_field/static/src/xml/web_tree_dynamic_colored_field.xml
  4. 2
      web_tree_dynamic_colored_field/views/web_tree_dynamic_colored_field.xml

2
web_tree_dynamic_colored_field/__openerp__.py

@ -30,7 +30,7 @@
'views/web_tree_dynamic_colored_field.xml', 'views/web_tree_dynamic_colored_field.xml',
], ],
'qweb': [ 'qweb': [
'static/xml/*.xml',
'static/src/xml/*.xml',
], ],
'auto_install': False 'auto_install': False
} }

37
web_tree_dynamic_colored_field/static/js/web_tree_dynamic_colored_field.js → web_tree_dynamic_colored_field/static/src/js/web_tree_dynamic_colored_field.js

@ -1,8 +1,4 @@
openerp.web_tree_dynamic_colored_field = function(instance){ openerp.web_tree_dynamic_colored_field = function(instance){
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
var pair_colors = function(pair_color){ var pair_colors = function(pair_color){
if (pair_color != ""){ if (pair_color != ""){
var pair_list = pair_color.split(':'), var pair_list = pair_color.split(':'),
@ -25,10 +21,7 @@ openerp.web_tree_dynamic_colored_field = function(instance){
var ctx = _.extend( var ctx = _.extend(
{}, {},
record.attributes, record.attributes,
{
uid: obj.session.uid,
current_date: new Date().toString('yyyy-MM-dd')
}
instance.web.pyeval.context()
); );
for(i=0, len=colors.length; i<len; ++i) { for(i=0, len=colors.length; i<len; ++i) {
pair = colors[i]; pair = colors[i];
@ -54,33 +47,5 @@ openerp.web_tree_dynamic_colored_field = function(instance){
this._super(group, opts); this._super(group, opts);
this.columns.fct_colorize = colorize; this.columns.fct_colorize = colorize;
}, },
fct_colorize: colorize,
render: function() {
this.$current.empty().append(
QWeb.render('ListView.rows', _.extend({
render_cell: function () {
return self.render_cell.apply(self, arguments); },
fct_colorize: function(){
return self.fct_colorize.apply(self, arguments);
}
}, this)));
this.pad_table_to(4);
},
render_record: function(record) {
var self = this;
var index = this.records.indexOf(record);
return QWeb.render('ListView.row', {
columns: this.columns,
options: this.options,
record: record,
row_parity: (index % 2 === 0) ? 'even' : 'odd',
view: this.view,
render_cell: function () {
return self.render_cell.apply(self, arguments); },
fct_colorize: function(){
return self.fct_colorize.apply(self, arguments);
}
});
}
}); });
} }

2
web_tree_dynamic_colored_field/static/xml/web_tree_dynamic_colored_field.xml → web_tree_dynamic_colored_field/static/src/xml/web_tree_dynamic_colored_field.xml

@ -4,7 +4,7 @@
<tr t-extend="ListView.row"> <tr t-extend="ListView.row">
<t t-jquery="td[t-att-data-field='column.id']" t-operation="attributes"> <t t-jquery="td[t-att-data-field='column.id']" t-operation="attributes">
<attribute name="t-att-style">fct_colorize(record, column)</attribute>
<attribute name="t-att-style">columns.fct_colorize(record, column)</attribute>
</t> </t>
</tr> </tr>

2
web_tree_dynamic_colored_field/views/web_tree_dynamic_colored_field.xml

@ -5,7 +5,7 @@
<data> <data>
<template id="assets_backend" name="web_tree_dynamic_colored_field assets" inherit_id="web.assets_backend"> <template id="assets_backend" name="web_tree_dynamic_colored_field assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/web_tree_dynamic_colored_field/static/js/web_tree_dynamic_colored_field.js"></script>
<script type="text/javascript" src="/web_tree_dynamic_colored_field/static/src/js/web_tree_dynamic_colored_field.js"></script>
</xpath> </xpath>
</template> </template>
</data> </data>
Loading…
Cancel
Save