diff --git a/addons/pos_loyalty/loyalty.py b/addons/pos_loyalty/loyalty.py index ce80f6e16d2..e6b059d9e84 100644 --- a/addons/pos_loyalty/loyalty.py +++ b/addons/pos_loyalty/loyalty.py @@ -52,7 +52,7 @@ class loyalty_rule(osv.osv): 'name': fields.char('Name', size=32, select=1, required=True, help="An internal identification for this loyalty program rule"), 'loyalty_program_id': fields.many2one('loyalty.program', 'Loyalty Program', help='The Loyalty Program this exception belongs to'), 'product_id': fields.many2one('product.product','Target Product', help='The product affected by the rule'), - 'override': fields.boolean('Override Base Rules', help='A product targetted by this rule will be ignored by other loyalty rules, including the default one'), + 'cumulative': fields.boolean('Cumulative', help='The points won from this rule will be won in addition to other rules'), 'pp_product': fields.float('Points per product', help='How many points the product will earn per product ordered'), 'pp_currency': fields.float('Points per currency', help='How many points the product will earn per value sold'), } diff --git a/addons/pos_loyalty/static/src/js/loyalty.js b/addons/pos_loyalty/static/src/js/loyalty.js index 5673231f3af..766a5d3efc6 100644 --- a/addons/pos_loyalty/static/src/js/loyalty.js +++ b/addons/pos_loyalty/static/src/js/loyalty.js @@ -7,10 +7,7 @@ openerp.pos_loyalty = function(instance){ var models = module.PosModel.prototype.models; for (var i = 0; i < models.length; i++) { var model = models[i]; - if (model.model === 'product.product') { - model.fields.push('loyalty_points'); - model.fields.push('loyalty_override'); - } else if (model.model === 'res.partner') { + if (model.model === 'res.partner') { model.fields.push('loyalty_points'); } else if (model.model === 'pos.config') { // load loyalty after pos.config @@ -23,7 +20,7 @@ openerp.pos_loyalty = function(instance){ },{ model: 'loyalty.rule', condition: function(self){ return !!self.loyalty; }, - fields: ['name','type','product_id','category_id','override','pp_product','pp_currency'], + fields: ['name','type','product_id','category_id','cumulative','pp_product','pp_currency'], domain: function(self){ return [['loyalty_program_id','=',self.loyalty.id]]; }, loaded: function(self,rules){ @@ -34,7 +31,7 @@ openerp.pos_loyalty = function(instance){ var rule = rules[i]; if (!self.loyalty.rules_by_product_id[rule.product_id[0]]) { self.loyalty.rules_by_product_id[rule.product_id[0]] = [rule]; - } else if (rule.override) { + } else if (rule.cumulative) { self.loyalty.rules_by_product_id[rule.product_id[0]].unshift(rule); } else { self.loyalty.rules_by_product_id[rule.product_id[0]].push(rule); @@ -83,7 +80,7 @@ openerp.pos_loyalty = function(instance){ var rule = rules[j]; total_points += round_pr(line.get_quantity() * rule.pp_product, rounding); total_points += round_pr(line.get_price_with_tax() * rule.pp_currency, rounding); - if (rule.override) { + if (!rule.cumulative) { overriden = true; break; } diff --git a/addons/pos_loyalty/views/views.xml b/addons/pos_loyalty/views/views.xml index bcc431c0543..231c22eed92 100644 --- a/addons/pos_loyalty/views/views.xml +++ b/addons/pos_loyalty/views/views.xml @@ -49,7 +49,7 @@
-
@@ -68,7 +68,7 @@ - + @@ -99,7 +99,7 @@ - +