From a8d084025db504e19610aa6e47c4b9fcca1ea6bf Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 20 Jun 2017 13:15:35 +0200 Subject: [PATCH] [FIX] sale_coupon: Allow coupon usage for non customers Purpose ======= On a sale coupon program, the allowed partners are the customers by default. That way, users like the Administrator aren't allowed to use coupon on a fresh database Specification ============= Allow all the partners by default and the user restrict the partners as he wishes. Before this commit: Coupon Program: Only customers have access to rewards Promotional Program: Only customers have access to reward and this can be retricted with a domain After this commit: Coupon Program: All partners have access to rewards Promotional Program: All partners have access to reward and this can be retricted with a domain --- models/sale_coupon_rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/sale_coupon_rules.py b/models/sale_coupon_rules.py index 475e18a5934..5e840713dc3 100644 --- a/models/sale_coupon_rules.py +++ b/models/sale_coupon_rules.py @@ -12,7 +12,7 @@ class SaleCouponRule(models.Model): rule_date_from = fields.Datetime(string="Start Date", help="Coupon program start date") rule_date_to = fields.Datetime(string="End Date", help="Coupon program end date") - rule_partners_domain = fields.Char(string="Based on Customers", default=[['customer', '=', True]], help="Coupon program will work for selected customers only") + rule_partners_domain = fields.Char(string="Based on Customers", help="Coupon program will work for selected customers only") rule_partner_ids = fields.Many2many('res.partner', 'rule_partner_rel', 'rule_id', 'partner_id', string="Related Partners", compute='_compute_rule_partner_ids', store=True) rule_products_domain = fields.Char(string="Based on Products", default=[['sale_ok', '=', True]], help="On Purchase of selected product, reward will be given")