Merge pull request #5234 from expsa/task_4

Task 4
This commit is contained in:
NossibaElhadi 2025-11-05 14:31:05 +03:00 committed by GitHub
commit 365e737985
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 5 deletions

View File

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

View File

@ -109,6 +109,7 @@
<field name="kafala_status" widget="badge"
decoration-success="kafala_status == 'have_kafala'"
decoration-danger="kafala_status == 'have_not_kafala'"/>
<field name="sponsorship_end_date" optional="hide" />
</xpath>
</field>
</record>

View File

@ -485,7 +485,7 @@
<!-- </page>-->
<page string="Orphans and Widows List"
attrs="{'invisible': [('sponsorship_type', '!=', 'group')]}">
attrs="{'invisible': ['|',('sponsorship_type', '!=', 'group'), ('hide_beneficiary_group', '=', True)]}">
<!-- attrs="{'invisible': ['|', '|', '|', ('hide_beneficiary_group','=', True), ('parent.record_type','!=','sponsorship'), ('sponsorship_type', '!=', 'group'), ('benefit_type', '!=', 'both')]}">-->
<field name="benefit_ids" nolabel="1" options="{'no_create': True}">
<tree editable="bottom">