Sponsor(task02)

This commit is contained in:
eman 2024-12-15 18:08:52 +02:00
parent b1a353d52d
commit a371be16da
6 changed files with 41 additions and 6 deletions

View File

@ -1420,7 +1420,7 @@ class GrantBenefitProfile(models.Model):
'gender': 'female',
'relationn': rec.replacement_mother_relation.id,
'mother_marital_conf': rec.replacement_mother_marital_conf.id,
'mother_location': rec.replacement_mother_location_conf.id,
'mother_location_conf': rec.replacement_mother_location_conf.id,
'age': rec.replacement_mother_age,
'is_work': rec.replacement_is_mother_work,
'has_disabilities': rec.replacement_mother_has_disabilities,
@ -1520,7 +1520,7 @@ class GrantBenefitProfile(models.Model):
'gender': 'female',
'relationn': rec.replacement_mother_relation.id,
'mother_marital_conf': rec.replacement_mother_marital_conf.id,
'mother_location': rec.replacement_mother_location_conf.id,
'mother_location_conf': rec.replacement_mother_location_conf.id,
'age': rec.replacement_mother_age,
'is_work': rec.replacement_is_mother_work,
'has_disabilities': rec.replacement_mother_has_disabilities,

View File

@ -33,6 +33,7 @@
'views/takaful_grant_benefit_view.xml',
'views/takaful_month_payment_view.xml',
'wizards/benefit_month_payment_wiz_view.xml',
'views/takaful_conf.xml',
'views/reports_paperformats.xml',
'views/reports_templates.xml',

View File

@ -11,4 +11,5 @@ from . import takaful_res_partner_model
from . import takaful_push_notification
from . import takaful_contribution_model
from . import takaful_month_payment
from . import takaful_conf

View File

@ -44,7 +44,7 @@ class TakafulSponsorship(models.Model):
_description = "Sponsorship"
_rec_name = 'code'
sponsor_id = fields.Many2one('takaful.sponsor',string='Sponsor Name')
sponsor_id = fields.Many2one('takaful.sponsor',string='Sponsor Name',domain="[('branch_custom_id', '=', branch_custom_id),('branch_custom_id','!=',False)]")
member_id = fields.Many2one('res.partner',string='Member Name',domain="[('is_member', '=', True)]")
is_gift = fields.Selection([
@ -112,6 +112,7 @@ class TakafulSponsorship(models.Model):
)
has_needs = fields.Boolean(store=True)
donations_details_lines = fields.One2many('donations.details.lines','sponsorship_id')
@api.constrains('end_date')
def check_end_date(self):
@ -1058,3 +1059,11 @@ class AnotherSponsors(models.Model):
sponsor_id_number = fields.Char(string="Sponsor ID Number")
sponsorship_id = fields.Many2one('takaful.sponsorship')
class DonationsDetailsLines(models.Model):
_name = "donations.details.lines"
donation_type = fields.Selection([('donation', 'Donation'), ('waqf', 'Waqf'), ('sponsorship', 'Sponsorship'), ],string='Donation Type')
donation_name = fields.Many2one('donations.items', string="Donation Name" , domain="[('donation_type','=',donation_type),('show_donation_item','=',True)]")
sponsorship_id = fields.Many2one('takaful.sponsorship', string="Sponsorship")
donation_amount = fields.Float(string='Donation Amount')
donation_mechanism = fields.Selection([('with_conditions', 'With Conditions'),('without_conditions', 'Without Conditions')],string='Donation Mechanism')

View File

@ -20,3 +20,5 @@ access_month_payment_line,Full access on month.payment.line,model_month_payment_
access_sponsorship_benefit_arrears,Full access on sponsorship.benefit.arrears,model_sponsorship_benefit_arrears,odex_takaful.group_kufula_viewer,1,1,1,1
access_sponsorship_reason_stop,Full access on sponsorship.reason.stop,model_sponsorship_reason_stop,odex_takaful.group_kufula_viewer,1,1,1,1
access_donate_for_another_person,access_donate_for_another_person,model_donate_for_another_person,odex_takaful.group_kufula_viewer,1,1,1,1
access_donations_items,access_donations_items,model_donations_items,odex_takaful.group_kufula_viewer,1,1,1,1
access_donations_details_lines,access_donations_details_lines,model_donations_details_lines,odex_takaful.group_kufula_viewer,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
20 access_sponsorship_benefit_arrears Full access on sponsorship.benefit.arrears model_sponsorship_benefit_arrears odex_takaful.group_kufula_viewer 1 1 1 1
21 access_sponsorship_reason_stop Full access on sponsorship.reason.stop model_sponsorship_reason_stop odex_takaful.group_kufula_viewer 1 1 1 1
22 access_donate_for_another_person access_donate_for_another_person model_donate_for_another_person odex_takaful.group_kufula_viewer 1 1 1 1
23 access_donations_items access_donations_items model_donations_items odex_takaful.group_kufula_viewer 1 1 1 1
24 access_donations_details_lines access_donations_details_lines model_donations_details_lines odex_takaful.group_kufula_viewer 1 1 1 1

View File

@ -69,7 +69,7 @@
<field name="sponsor_name" attrs="{'invisible': [('sponsor_or_donor_type','!=','not_registered')]}"/>
<field name="sponsor_title" attrs="{'invisible': [('sponsor_or_donor_type','!=','not_registered'),('sponsor_or_donor_type','!=','unknown')]}"/>
<field name="sponsor_phone" attrs="{'invisible': [('sponsor_or_donor_type','!=','not_registered'),('sponsor_or_donor_type','!=','unknown')]}"/>
<field name="sponsor_id" attrs="{'invisible': ['|',('registered_type','!=','sponsor'),('sponsor_or_donor_type','=','registered')],'required':[('state','!=','draft')],'readonly':[('sponsor_or_donor_type','=','new_sponsor')]}" force_save="1"/>
<field name="sponsor_id" attrs="{'invisible': ['|',('sponsor_or_donor_type','!=','new_sponsor'),('sponsor_or_donor_type','!=','registered'),('registered_type','=','member')],'required':[('state','!=','draft')],'readonly':[('sponsor_or_donor_type','=','new_sponsor')]}" force_save="1"/>
<field name="member_id" attrs="{'invisible': [('registered_type','!=','member')]}"/>
<field name="sponsorship_type"/>
<field name="benefit_type"/>
@ -180,8 +180,8 @@
<field name="with_orphan_ids" readonly="1" widget="many2many" nolabel="1" attrs="{'invisible': [('is_widow_orphan', '=', False)]}"/>
</group>
<group>
<notebook attrs="{'invisible':[('donate_for_another_person','=',False)]}">
<page string="Another Sponsors">
<notebook>
<page string="Another Sponsors" attrs="{'invisible':[('donate_for_another_person','=',False)]}">
<field name="another_sponsors">
<tree editable="bottom">
<field name="sponsor_name"/>
@ -190,6 +190,28 @@
</tree>
</field>
</page>
<page string="Donation Details">
<field name="donations_details_lines">
<form string="Donation Details">
<group>
<group>
<field name="donation_type"/>
<field name="donation_name"/>
</group>
<group>
<field name="donation_amount"/>
<field name="donation_mechanism" attrs="{'invisible': ['|',('donation_type','=','sponsorship'),('donation_type','=','waqf')]}"/>
</group>
</group>
</form>
<tree>
<field name="donation_type"/>
<field name="donation_name"/>
<field name="donation_amount"/>
<field name="donation_mechanism" attrs="{'invisible': ['|',('donation_type','=','sponsorship'),('donation_type','=','waqf')]}"/>
</tree>
</field>
</page>
</notebook>
</group>