Hello fellows, how you doing?
I build my custom template for invoice analysis and it's being displayed twice. The first one empty once any search was did and the second when it returns a search result... May could some one help me?
start: function() {
var sup = this._super();
var self = this;
self.render();
},
/*render template passing no values*/
render: function(){
var self = this;
var invoices = Invoices.call('dashboard_invoceis_action_id', []).then(function(result){
self.$el.append(QWeb.render('InvoiceTemplate', {invoices: result}));
});
},
do_search: function(event) {
var self = this;
if(event.which == 13) {
var search_term = $(event.currentTarget).val();
var invoice_id = $(event.currentTarget).data('export-id');
var invoices = Invoices.call('do_search', [{'search_term':search_term}]).then(function(result){
self.$el.append(QWeb.render('InvoiceTemplate', {invoices: result}));
});
}
},