Skip to content

Commit

Permalink
[FIX] pos_loyalty: record the loyalty points while offline. (do not f…
Browse files Browse the repository at this point in the history
…orward-port)
  • Loading branch information
fvdsn committed Jun 29, 2015
1 parent 50c1475 commit 55881d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions addons/point_of_sale/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ //
}
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){
Expand Down
5 changes: 3 additions & 2 deletions addons/pos_loyalty/static/src/js/loyalty.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,13 @@ openerp.pos_loyalty = function(instance){
}
},

validate: function(){
finalize: function(){
var client = this.get_client();
if ( client ) {
client.loyalty_points = this.get_new_total_points();
}
_super.prototype.validate.apply(this,arguments);
this.pos.gui.screen_instances.clientlist.partner_cache.clear_node(client.id);
_super.prototype.finalize.apply(this,arguments);
},

export_for_printing: function(){
Expand Down

0 comments on commit 55881d3

Please sign in to comment.