FIX benefit ids view
This commit is contained in:
parent
f5cc178455
commit
dd46fa9e58
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue