[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
This commit is contained in:
Yannick Tivisse
2017-06-21 15:53:15 +02:00
parent be8d0cf716
commit a8d084025d
+1 -1
View File
@@ -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")