Skip to content

Commit

Permalink
G2P-1803: Added Reimbursement import service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
dibik96 committed Mar 26, 2024
1 parent 5eb551b commit 95cccd6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions g2p_program_reimbursement/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from . import entitlement
from . import cycle
from . import entitlement_manager
from . import eligibility_manager
17 changes: 17 additions & 0 deletions g2p_program_reimbursement/models/eligibility_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from odoo import models


class G2PDefaultEligibilityManager(models.Model):
_inherit = "g2p.program_membership.manager.default"

def _prepare_eligible_domain(self, membership=None):
domain = super()._prepare_eligible_domain(membership)
if self.env.context.get("is_reimbursement_program"):
domain = []
domain = [
("supplier_rank", ">", 0),
("is_group", "=", False),
("is_registrant", "=", False),
]
return domain
return domain
3 changes: 3 additions & 0 deletions g2p_program_reimbursement/wizard/create_program_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class G2PCreateNewReimbursementProgramWiz(models.TransientModel):
is_reimbursement_program = fields.Boolean(default=False)

def create_program(self):
if self.is_reimbursement_program:
self.env.context = {"is_reimbursement_program": True}

res = super(G2PCreateNewReimbursementProgramWiz, self).create_program()
for rec in self:
program = self.env["g2p.program"].browse(res["res_id"])
Expand Down

0 comments on commit 95cccd6

Please sign in to comment.