Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
[FIX] error on auto filtering mechanism for compliance criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatnm0612 committed Nov 2, 2023
1 parent 9d21183 commit 9806346
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def _add_beneficiaries(self, cycle, beneficiaries, state="draft", do_count=False
"0",
)
)
if automated_beneficiaries_filtering_mechanism == "1":
if (
automated_beneficiaries_filtering_mechanism == "1"
and cycle.program_id.compliance_managers
):
domain = cycle._get_compliance_criteria_domain()
new_domain = AND([domain, [["id", "in", beneficiaries]]])
beneficiaries = self.env["res.partner"].sudo().search(new_domain).ids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ def prepare_entitlements(self, cycle, beneficiaries):
"0",
)
)
if automated_beneficiaries_filtering_mechanism == "2":
if (
automated_beneficiaries_filtering_mechanism == "2"
and cycle.program_id.compliance_managers
):
satisfied_registrant_ids = (
self.env["res.partner"]
.sudo()
Expand Down

0 comments on commit 9806346

Please sign in to comment.