Browse Source

[IMP] change coop_candidate computation

pull/1/head
houssine 7 years ago
parent
commit
3842f0ed89
  1. 5
      easy_my_coop/models/partner.py

5
easy_my_coop/models/partner.py

@ -115,11 +115,10 @@ class ResPartner(models.Model):
@api.depends('subscription_request_ids.state') @api.depends('subscription_request_ids.state')
def _compute_coop_candidate(self): def _compute_coop_candidate(self):
for partner in self: for partner in self:
paid_sub_req = partner.subscription_request_ids.filtered(lambda record: record.state == 'paid')
if paid_sub_req:
if partner.member:
is_candidate = False is_candidate = False
else: else:
if len(partner.subscription_request_ids.filtered(lambda record: record.state != 'cancelled')) > 0:
if len(partner.subscription_request_ids.filtered(lambda record: record.state == 'done')) > 0:
is_candidate = True is_candidate = True
else : else :
is_candidate = False is_candidate = False

Loading…
Cancel
Save