|
@ -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 |
|
|