diff options
| author | Frédéric van der Essen <fvdessen@gmail.com> | 2015-06-29 18:00:35 +0200 |
|---|---|---|
| committer | Frédéric van der Essen <fvdessen@gmail.com> | 2015-06-29 18:00:35 +0200 |
| commit | 55881d3ec31a2655fbed9fa68ff212c83675b54a (patch) | |
| tree | 79064534c8c40acba44712315c47380e00f85da1 /addons | |
| parent | 50c147514ef9f1359e674a39fd70cf37d60ed2a8 (diff) | |
[FIX] pos_loyalty: record the loyalty points while offline. (do not forward-port)
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/js/screens.js | 8 | ||||
| -rw-r--r-- | addons/pos_loyalty/static/src/js/loyalty.js | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 0e817695a6d..34bead921c2 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -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){ diff --git a/addons/pos_loyalty/static/src/js/loyalty.js b/addons/pos_loyalty/static/src/js/loyalty.js index 28e74e895f7..ea3214bc818 100644 --- a/addons/pos_loyalty/static/src/js/loyalty.js +++ b/addons/pos_loyalty/static/src/js/loyalty.js @@ -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(){ |
