[FIX] pos_loyalty: show loyalty points updates in the customer list screen

This commit is contained in:
Frédéric van der Essen
2015-05-04 14:13:44 +02:00
parent 64cb8cf8ab
commit 3149c1e03f
2 changed files with 15 additions and 3 deletions
@@ -209,6 +209,14 @@ var DomCache = core.Class.extend({
}
return node;
},
clear_node: function(key) {
var cached = this.cache[key];
if (cached) {
delete this.cache[key];
delete this.access_time[key];
this.size --;
}
},
get_node: function(key){
var cached = this.cache[key];
if(cached){
+7 -3
View File
@@ -315,13 +315,17 @@ models.Order = models.Order.extend({
});
}
},
validate: function(){
finalize: function(){
var client = this.get_client();
if ( client ) {
client.loyalty_points = this.get_new_total_points();
// The client list screen has a cache to avoid re-rendering
// the client lines, and so the point updates may not be visible ...
// We need a better GUI framework !
this.pos.gui.screen_instances.clientlist.partner_cache.clear_node(client.id);
}
_super.prototype.validate.apply(this,arguments);
_super.prototype.finalize.apply(this,arguments);
},
export_for_printing: function(){