commit
ec9b6a8be7
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
from odoo.exceptions import UserError , ValidationError
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class DonationsItems(models.Model):
|
||||
_name = "donations.items"
|
||||
_description = "DonationsItems"
|
||||
|
||||
name = fields.Char(string="Donation Name")
|
||||
donation_type = fields.Selection([('donation', 'Donation'),('waqf', 'Waqf'),('sponsorship', 'Sponsorship'),], string='Donation Type')
|
||||
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
|
||||
show_donation_item = fields.Boolean(string='Show Donation Item')
|
||||
|
|
@ -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')
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
|
@ -0,0 +1,50 @@
|
|||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="donations_items_form">
|
||||
<field name="name">donations.items.form</field>
|
||||
<field name="model">donations.items</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Donations Items">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="donation_type"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="show_donation_item"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="donations_items_tree" model="ir.ui.view">
|
||||
<field name="name">donations.items.tree</field>
|
||||
<field name="model">donations.items</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Donations Items">
|
||||
<field name="name"/>
|
||||
<field name="donation_type"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="show_donation_item"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="donations_items_action" model="ir.actions.act_window">
|
||||
<field name="name">Donations Items</field>
|
||||
<field name="res_model">donations.items</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create a Donation Item
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_donations_items" name="Donations Items"
|
||||
parent="sponsor_setting_menu"
|
||||
action="donations_items_action" />
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue