[IMP] point_of_sale: add missing functionality necessary for the loyalty module

This commit is contained in:
Frederic van der Essen 2014-08-21 12:19:04 +02:00
parent a54aac38f6
commit 2fd16b5552
2 changed files with 5 additions and 1 deletions

View File

@ -662,7 +662,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
var partner = partners[i];
var clientline = this.partner_cache.get_node(partner.id);
if(!clientline){
var clientline_html = QWeb.render('ClientLine',{partner:partners[i]});
var clientline_html = QWeb.render('ClientLine',{widget: this, partner:partners[i]});
var clientline = document.createElement('tbody');
clientline.innerHTML = clientline_html;
clientline = clientline.childNodes[1];

View File

@ -46,6 +46,10 @@ function openerp_pos_basewidget(instance, module){ //module is instance.point_of
hide: function(){
this.$el.addClass('oe_hidden');
},
format_pr: function(value,precision){
var decimals = precision > 0 ? Math.max(0,Math.ceil(Math.log(1.0/precision) / Math.log(10))) : 0;
return value.toFixed(decimals);
},
});
}