Commit 72e81ad2 by Damien Moulard

update partner target status also when points are added

parent bd819db7
...@@ -10,11 +10,11 @@ class ShiftCounterEvent(models.Model): ...@@ -10,11 +10,11 @@ class ShiftCounterEvent(models.Model):
def _update_partner_target_status(self, vals): def _update_partner_target_status(self, vals):
"""actions if point_qty is negative""" """actions when points are removed or added"""
conf = self.env['ir.config_parameter'] conf = self.env['ir.config_parameter']
suspension_limit = int(conf.get_param("lacagette_membership.points_limit_to_get_suspended")) suspension_limit = int(conf.get_param("lacagette_membership.points_limit_to_get_suspended"))
unsubscribe_limit = int(conf.get_param("lacagette_membership.points_limit_to_get_unsubscribed")) unsubscribe_limit = int(conf.get_param("lacagette_membership.points_limit_to_get_unsubscribed"))
if vals['point_qty'] < 0: if vals['point_qty'] != 0:
res_partner = self.env['res.partner'].search([('id', '=', vals['partner_id'])]) res_partner = self.env['res.partner'].search([('id', '=', vals['partner_id'])])
if res_partner: if res_partner:
p = res_partner[0] p = res_partner[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment