diff --git a/odex25_ensan/odex_takaful/models/donation_details_lines.py b/odex25_ensan/odex_takaful/models/donation_details_lines.py index 8b317bcd6..c8dbaff2e 100644 --- a/odex25_ensan/odex_takaful/models/donation_details_lines.py +++ b/odex25_ensan/odex_takaful/models/donation_details_lines.py @@ -572,10 +572,15 @@ class DonationsDetailsLines(models.Model): ('member_id_number', '=', rec.benefit_id_number) ]]) - if rec.payment_month_count < 6 and rec.record_type == "sponsorship" and rec.sponsorship_duration == "temporary": - benefit_age_limit = 16 if rec.direct_debit else 18 - domain = expression.AND([domain, [ - ('age', '>=', benefit_age_limit) + if rec.record_type == "sponsorship" and rec.sponsorship_duration == "temporary": + benefit_age_limit = None + if rec.direct_debit: + benefit_age_limit = 16 + elif rec.payment_month_count < 6: + benefit_age_limit = 18 + if benefit_age_limit: + domain = expression.AND([domain, [ + ('age', '>=', benefit_age_limit) ]]) elif rec.record_type == 'donation' and rec.donation_mechanism == "with_conditions" and rec.family_id: domain = [("benefit_id", "=", rec.family_id.id)] diff --git a/odex25_ensan/odex_takaful/views/family_member.xml b/odex25_ensan/odex_takaful/views/family_member.xml index d10e6af69..7a8632f7a 100644 --- a/odex25_ensan/odex_takaful/views/family_member.xml +++ b/odex25_ensan/odex_takaful/views/family_member.xml @@ -109,6 +109,7 @@ + diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index 5d18333d2..5291bc911 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -485,7 +485,7 @@ + attrs="{'invisible': ['|',('sponsorship_type', '!=', 'group'), ('hide_beneficiary_group', '=', True)]}">