[FIX] customer notes
This commit is contained in:
parent
1ba0fd76e7
commit
2aec2b3e7e
|
|
@ -7614,3 +7614,23 @@ msgstr "العمر"
|
||||||
msgid "Diseases Attachment"
|
msgid "Diseases Attachment"
|
||||||
msgstr "الأمراض"
|
msgstr "الأمراض"
|
||||||
|
|
||||||
|
#. module: odex_takaful
|
||||||
|
#: model:ir.model.fields.selection,name:odex_takaful.selection__family_member__benefit_group__orphan
|
||||||
|
msgid "Orphans"
|
||||||
|
msgstr "الأيتام"
|
||||||
|
|
||||||
|
#. module: odex_takaful
|
||||||
|
#: model:ir.model.fields.selection,name:odex_takaful.selection__family_member__benefit_group__widow
|
||||||
|
msgid "Widows"
|
||||||
|
msgstr "أم الايتام"
|
||||||
|
|
||||||
|
#. module: odex_takaful
|
||||||
|
#: model:ir.model.fields.selection,name:odex_takaful.selection__product_template__target_donation__not_target
|
||||||
|
msgid "Not Target"
|
||||||
|
msgstr "تبرعات"
|
||||||
|
|
||||||
|
#. module: odex_takaful
|
||||||
|
#: model:ir.model.fields.selection,name:odex_takaful.selection__product_template__target_donation__target
|
||||||
|
msgid "Target"
|
||||||
|
msgstr "حملات"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class DonationsDetailsLines(models.Model):
|
||||||
members_domain_ids = fields.Many2many('family.member', compute='_compute_members_domain_ids')
|
members_domain_ids = fields.Many2many('family.member', compute='_compute_members_domain_ids')
|
||||||
family_domain_ids = fields.Many2many('grant.benefit', compute='_compute_family_domain_ids')
|
family_domain_ids = fields.Many2many('grant.benefit', compute='_compute_family_domain_ids')
|
||||||
benefit_id = fields.Many2one('family.member', string='Beneficiary Name', ondelete='restrict', domain="[('id', 'in', members_domain_ids)]", tracking=True)
|
benefit_id = fields.Many2one('family.member', string='Beneficiary Name', ondelete='restrict', domain="[('id', 'in', members_domain_ids)]", tracking=True)
|
||||||
family_id = fields.Many2one('grant.benefit', string='Family', ondelete='restrict', domain="[('id', 'in', family_domain_ids)]", tracking=True)
|
family_id = fields.Many2one('grant.benefit', string='Family', ondelete='restrict', domain="[('id', 'in', family_domain_ids)]", tracking=True, compute='_compute_family_id', store=True)
|
||||||
benefit_ids = fields.Many2many('family.member', string='Beneficiaries Names', tracking=True, domain="[('id', 'in', members_domain_ids) , ('age' , '<' , ages)]")
|
benefit_ids = fields.Many2many('family.member', string='Beneficiaries Names', tracking=True, domain="[('id', 'in', members_domain_ids) , ('age' , '<' , ages)]")
|
||||||
sponsorship_duration = fields.Selection([('temporary', 'Temporary'), ('permanent', 'Permanent')],
|
sponsorship_duration = fields.Selection([('temporary', 'Temporary'), ('permanent', 'Permanent')],
|
||||||
string='Sponsorship Type', default="temporary")
|
string='Sponsorship Type', default="temporary")
|
||||||
|
|
@ -347,7 +347,11 @@ class DonationsDetailsLines(models.Model):
|
||||||
def onset_benefit_id(self):
|
def onset_benefit_id(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.state == 'waiting' and (rec.benefit_id or rec.benefit_ids):
|
if rec.state == 'waiting' and (rec.benefit_id or rec.benefit_ids):
|
||||||
rec.state = 'active'
|
if rec.sponsorship_duration == 'permanent':
|
||||||
|
rec.state = 'paid'
|
||||||
|
else:
|
||||||
|
rec.state = 'active'
|
||||||
|
|
||||||
sponsor_id = rec.sponsorship_mechanism_id.sponsor_id.id if rec.sponsorship_mechanism_id else rec.sponsorship_id.sponsor_id.id
|
sponsor_id = rec.sponsorship_mechanism_id.sponsor_id.id if rec.sponsorship_mechanism_id else rec.sponsorship_id.sponsor_id.id
|
||||||
(rec.benefit_id | rec.benefit_ids).write(
|
(rec.benefit_id | rec.benefit_ids).write(
|
||||||
{'sponsor_related_id': sponsor_id, 'kafala_status': 'have_kafala', "sponsorship_end_date": rec.end_date if rec.end_date else False})
|
{'sponsor_related_id': sponsor_id, 'kafala_status': 'have_kafala', "sponsorship_end_date": rec.end_date if rec.end_date else False})
|
||||||
|
|
@ -362,11 +366,6 @@ class DonationsDetailsLines(models.Model):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
rec.total_months_amount = rec.donation_amount * rec.payment_month_count
|
rec.total_months_amount = rec.donation_amount * rec.payment_month_count
|
||||||
|
|
||||||
@api.onchange('sponsorship_duration')
|
|
||||||
def _onchange_sponsorship_duration(self):
|
|
||||||
for rec in self:
|
|
||||||
if rec.sponsorship_duration == "permanent":
|
|
||||||
rec.direct_debit = False
|
|
||||||
|
|
||||||
@api.onchange('product_template_id')
|
@api.onchange('product_template_id')
|
||||||
def _onchange_product_template_id(self):
|
def _onchange_product_template_id(self):
|
||||||
|
|
@ -610,6 +609,11 @@ class DonationsDetailsLines(models.Model):
|
||||||
@api.onchange('sponsorship_duration', 'direct_debit', 'record_type')
|
@api.onchange('sponsorship_duration', 'direct_debit', 'record_type')
|
||||||
def _onchange_sponsorship_duration(self):
|
def _onchange_sponsorship_duration(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
if rec.sponsorship_duration == "permanent":
|
||||||
|
rec.direct_debit = False
|
||||||
|
rec.payment_month_count = 1
|
||||||
|
rec.benefit_id = False
|
||||||
|
rec.benefit_ids = [(5, 0, 0)]
|
||||||
if rec.record_type == "sponsorship" and rec.sponsorship_duration:
|
if rec.record_type == "sponsorship" and rec.sponsorship_duration:
|
||||||
product_templ_id = self.env["product.template"].sudo().search([("sponsorship_duration", "=", rec.sponsorship_duration)], limit=1)
|
product_templ_id = self.env["product.template"].sudo().search([("sponsorship_duration", "=", rec.sponsorship_duration)], limit=1)
|
||||||
if product_templ_id:
|
if product_templ_id:
|
||||||
|
|
@ -617,6 +621,12 @@ class DonationsDetailsLines(models.Model):
|
||||||
if rec.sponsorship_duration == 'temporary' and not rec.direct_debit:
|
if rec.sponsorship_duration == 'temporary' and not rec.direct_debit:
|
||||||
rec.start_date = fields.Date.context_today(rec)
|
rec.start_date = fields.Date.context_today(rec)
|
||||||
|
|
||||||
|
@api.onchange('payment_month_count')
|
||||||
|
def _onchange_payment_month_count(self):
|
||||||
|
for rec in self:
|
||||||
|
rec.benefit_id = False
|
||||||
|
rec.benefit_ids = [(5, 0, 0)]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|
@ -633,14 +643,14 @@ class DonationsDetailsLines(models.Model):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('donation_types', 'donation_type')
|
@api.onchange('donation_types', 'donation_type', 'record_type')
|
||||||
def _onchange_sponsorship_type(self):
|
def _onchange_sponsorship_type(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.sponsorship_mechanism_id:
|
if rec.sponsorship_mechanism_id:
|
||||||
if rec.sponsorship_mechanism_id.record_type == 'sponsorship':
|
if rec.sponsorship_mechanism_id.record_type == 'sponsorship':
|
||||||
rec.donation_type = 'sponsorship'
|
rec.donation_type = 'sponsorship'
|
||||||
|
|
||||||
if rec.donation_types:
|
elif rec.donation_types:
|
||||||
if rec.donation_types == 'donation':
|
if rec.donation_types == 'donation':
|
||||||
rec.donation_type = 'donation'
|
rec.donation_type = 'donation'
|
||||||
elif rec.donation_types == 'waqf':
|
elif rec.donation_types == 'waqf':
|
||||||
|
|
@ -678,6 +688,21 @@ class DonationsDetailsLines(models.Model):
|
||||||
else:
|
else:
|
||||||
rec.total_donation_amount = rec.total_months_amount * (rec.benefits_count or 1)
|
rec.total_donation_amount = rec.total_months_amount * (rec.benefits_count or 1)
|
||||||
|
|
||||||
|
@api.depends('record_type', 'benefit_id')
|
||||||
|
def _compute_family_id(self):
|
||||||
|
for rec in self:
|
||||||
|
if rec.family_id:
|
||||||
|
rec.benefit_family_code = rec.family_id.code
|
||||||
|
continue
|
||||||
|
|
||||||
|
family = False
|
||||||
|
if rec.record_type == 'sponsorship':
|
||||||
|
if rec.benefit_id and rec.benefit_id.benefit_id:
|
||||||
|
family = rec.benefit_id.benefit_id
|
||||||
|
|
||||||
|
rec.family_id = family or False
|
||||||
|
rec.benefit_family_code = family.code if family else False
|
||||||
|
|
||||||
@api.depends('family_id','record_type')
|
@api.depends('family_id','record_type')
|
||||||
def _compute_family_domain_ids(self):
|
def _compute_family_domain_ids(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,25 @@ class FamilyMember(models.Model):
|
||||||
string='Kafala Status', compute='_compute_kafala_status', store=True, readonly=True)
|
string='Kafala Status', compute='_compute_kafala_status', store=True, readonly=True)
|
||||||
education_levels = fields.Many2one("education.level", string='Education Levels', compute='_compute_education_levels', store=True)
|
education_levels = fields.Many2one("education.level", string='Education Levels', compute='_compute_education_levels', store=True)
|
||||||
number_of_family_member = fields.Integer(compute='_compute_number_of_family_member' , store=True, string='Number Of Family Member')
|
number_of_family_member = fields.Integer(compute='_compute_number_of_family_member' , store=True, string='Number Of Family Member')
|
||||||
|
benefit_group = fields.Selection(
|
||||||
|
[
|
||||||
|
('orphan', 'Orphans'),
|
||||||
|
('widow', 'Widows'),
|
||||||
|
('other', 'Other'),
|
||||||
|
],
|
||||||
|
compute='_compute_benefit_group',
|
||||||
|
store=True
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends('relationn_type')
|
||||||
|
def _compute_benefit_group(self):
|
||||||
|
for rec in self:
|
||||||
|
if rec.relationn_type in ('son', 'daughter'):
|
||||||
|
rec.benefit_group = 'orphan'
|
||||||
|
elif rec.relationn_type in ('mother', 'replacement_mother'):
|
||||||
|
rec.benefit_group = 'widow'
|
||||||
|
else:
|
||||||
|
rec.benefit_group = 'other'
|
||||||
|
|
||||||
@api.depends('benefit_id','relationn','member_status')
|
@api.depends('benefit_id','relationn','member_status')
|
||||||
def _compute_number_of_family_member(self):
|
def _compute_number_of_family_member(self):
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,16 @@ class ProductTemplate(models.Model):
|
||||||
string='Sponsorship Duration Type')
|
string='Sponsorship Duration Type')
|
||||||
_quantity = fields.Float(default=0, store=True)
|
_quantity = fields.Float(default=0, store=True)
|
||||||
payment_method_id = fields.Many2one('takaful.payment.method', string="Payment Method")
|
payment_method_id = fields.Many2one('takaful.payment.method', string="Payment Method")
|
||||||
|
target_donation = fields.Selection([('target', 'Target'), ('not_target', 'Not Target')],
|
||||||
|
string='Duration Targeted', compute='_compute_target_donation', store=True)
|
||||||
|
|
||||||
|
@api.depends('target_amount')
|
||||||
|
def _compute_target_donation(self):
|
||||||
|
for rec in self:
|
||||||
|
if rec.target_amount > 0 :
|
||||||
|
rec.target_donation = 'target'
|
||||||
|
else:
|
||||||
|
rec.target_donation = 'not_target'
|
||||||
|
|
||||||
def _compute_fixed_value(self):
|
def _compute_fixed_value(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<field name="benefit_id"/>
|
<field name="benefit_id"/>
|
||||||
<field name="product_template_id"/>
|
<field name="product_template_id"/>
|
||||||
<field name="branch_custom_id"/>
|
<field name="branch_custom_id"/>
|
||||||
|
<field name="family_id"/>
|
||||||
<field name="education_level"/>
|
<field name="education_level"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<!-- State Filters -->
|
<!-- State Filters -->
|
||||||
|
|
@ -78,7 +79,7 @@
|
||||||
|
|
||||||
<field name="sponsor_phone" widget="phone"/>
|
<field name="sponsor_phone" widget="phone"/>
|
||||||
<field name="donation_type" optional="hide"/>
|
<field name="donation_type" optional="hide"/>
|
||||||
<field name="sponsorship_duration" optional="hide"/>
|
<field name="sponsorship_duration" />
|
||||||
<field name="donation_mechanism" optional="hide"/>
|
<field name="donation_mechanism" optional="hide"/>
|
||||||
<field name="product_template_id" />
|
<field name="product_template_id" />
|
||||||
<field name="benefit_status" widget="badge"
|
<field name="benefit_status" widget="badge"
|
||||||
|
|
@ -94,7 +95,8 @@
|
||||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||||
<field name="currency_id" invisible="1"/>
|
<field name="currency_id" invisible="1"/>
|
||||||
<field name="branch_custom_id" optional="hide" />
|
<field name="branch_custom_id" optional="hide" />
|
||||||
<field name="benefit_family_code" optional="hide" />
|
<field name="family_id" optional="hide" />
|
||||||
|
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||||
<field name="benefit_id" optional="hide" />
|
<field name="benefit_id" optional="hide" />
|
||||||
<!-- <field name="sponsorship_creation_date" />-->
|
<!-- <field name="sponsorship_creation_date" />-->
|
||||||
<field name="create_date" optional="hide"/>
|
<field name="create_date" optional="hide"/>
|
||||||
|
|
@ -396,7 +398,8 @@
|
||||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||||
<field name="currency_id" invisible="1"/>
|
<field name="currency_id" invisible="1"/>
|
||||||
<field name="branch_custom_id" optional="hide" />
|
<field name="branch_custom_id" optional="hide" />
|
||||||
<field name="benefit_family_code" optional="hide" />
|
<field name="family_id" optional="hide" />
|
||||||
|
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||||
<field name="benefit_id" optional="hide" />
|
<field name="benefit_id" optional="hide" />
|
||||||
<!-- <field name="sponsorship_creation_date" />-->
|
<!-- <field name="sponsorship_creation_date" />-->
|
||||||
<field name="create_date" optional="hide"/>
|
<field name="create_date" optional="hide"/>
|
||||||
|
|
@ -449,7 +452,8 @@
|
||||||
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
<field name="total_donation_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||||
<field name="currency_id" invisible="1"/>
|
<field name="currency_id" invisible="1"/>
|
||||||
<field name="branch_custom_id" optional="hide" />
|
<field name="branch_custom_id" optional="hide" />
|
||||||
<field name="benefit_family_code" optional="hide" />
|
<field name="family_id" optional="hide" />
|
||||||
|
<!-- <field name="benefit_family_code" optional="hide" />-->
|
||||||
<field name="benefit_id" optional="hide" />
|
<field name="benefit_id" optional="hide" />
|
||||||
<!-- <field name="sponsorship_creation_date" />-->
|
<!-- <field name="sponsorship_creation_date" />-->
|
||||||
<field name="create_date" optional="hide"/>
|
<field name="create_date" optional="hide"/>
|
||||||
|
|
|
||||||
|
|
@ -99,10 +99,11 @@
|
||||||
domain="[('education_status', '=', 'under_study_age')]"/>
|
domain="[('education_status', '=', 'under_study_age')]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<group>
|
<group>
|
||||||
<filter string="Education Level"
|
<filter string="Orphans / Widows" name="group_benefit_type" context="{'group_by': 'benefit_group'}"/>
|
||||||
name="group_education_level"
|
<filter string="Education Level"
|
||||||
context="{'group_by': 'education_levels'}"/>
|
name="group_education_level"
|
||||||
</group>
|
context="{'group_by': 'education_levels'}"/>
|
||||||
|
</group>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,8 @@
|
||||||
<!-- attrs="{'column_invisible': [('parent.record_type', '!=', 'donation')], 'required': [('parent.record_type', '=', 'donation'), ('display_type', '=', False)]}"-->
|
<!-- attrs="{'column_invisible': [('parent.record_type', '!=', 'donation')], 'required': [('parent.record_type', '=', 'donation'), ('display_type', '=', False)]}"-->
|
||||||
<field name="product_template_id"
|
<field name="product_template_id"
|
||||||
attrs="{'required': [('display_type', '=', False)]}"
|
attrs="{'required': [('display_type', '=', False)]}"
|
||||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"
|
||||||
|
context="{'group_by': 'target_donation'}"/>
|
||||||
<field name="name" widget="section_and_note_text" optional="show"/>
|
<field name="name" widget="section_and_note_text" optional="show"/>
|
||||||
<field name="direct_debit"/>
|
<field name="direct_debit"/>
|
||||||
<field name="journal_id"
|
<field name="journal_id"
|
||||||
|
|
@ -547,7 +548,8 @@
|
||||||
<field name="sponsorship_duration"
|
<field name="sponsorship_duration"
|
||||||
attrs="{'invisible': [('record_type','!=','sponsorship')], 'required': [('record_type','=','sponsorship')]}"/>
|
attrs="{'invisible': [('record_type','!=','sponsorship')], 'required': [('record_type','=','sponsorship')]}"/>
|
||||||
<field name="product_template_id"
|
<field name="product_template_id"
|
||||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"
|
||||||
|
context="{'group_by': 'target_donation'}"/>
|
||||||
<field name="payment_month_count_visibility" invisible="1"/>
|
<field name="payment_month_count_visibility" invisible="1"/>
|
||||||
<field name="direct_debit"
|
<field name="direct_debit"
|
||||||
attrs="{'invisible': [('sponsorship_duration','=','permanent')]}"/>
|
attrs="{'invisible': [('sponsorship_duration','=','permanent')]}"/>
|
||||||
|
|
@ -632,8 +634,9 @@
|
||||||
<page string="Orphans and Widows List"
|
<page string="Orphans and Widows List"
|
||||||
attrs="{'invisible': ['|',('sponsorship_type', '!=', 'group'), ('hide_beneficiary_group', '=', True)]}">
|
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')]}">-->
|
<!-- 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}">
|
<field name="benefit_ids" nolabel="1" options="{'no_create': True}" context="{'group_by': 'benefit_group'}">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
|
<field name="benefit_group" invisible="1"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="age"/>
|
<field name="age"/>
|
||||||
<field name="member_status"/>
|
<field name="member_status"/>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<field name="members_domain_ids" invisible="1"/>
|
<field name="members_domain_ids" invisible="1"/>
|
||||||
<group>
|
<group>
|
||||||
<group string="Benefit Information">
|
<group string="Benefit Information">
|
||||||
<field name="benefit_id"/>
|
<field name="benefit_id" context="{'group_by': 'benefit_group'}"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
<field name="old_family_id" attrs="{'invisible': [('record_type', '=', 'sponsorship')], 'required': [('record_type', '=', 'donation')]}"/>
|
<field name="old_family_id" attrs="{'invisible': [('record_type', '=', 'sponsorship')], 'required': [('record_type', '=', 'donation')]}"/>
|
||||||
<field name="old_members_id" attrs="{'invisible': [('record_type', '=', 'donation')], 'required': [('record_type', '=', 'sponsorship')]}"/>
|
<field name="old_members_id" attrs="{'invisible': [('record_type', '=', 'donation')], 'required': [('record_type', '=', 'sponsorship')]}"/>
|
||||||
<field name="new_family_id" attrs="{'invisible': [('record_type', '=', 'sponsorship')], 'required': [('record_type', '=', 'donation')]}" options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
<field name="new_family_id" attrs="{'invisible': [('record_type', '=', 'sponsorship')], 'required': [('record_type', '=', 'donation')]}" options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||||
<field name="new_members_id" attrs="{'invisible': [('record_type', '=', 'donation')], 'required': [('record_type', '=', 'sponsorship')]}" options="{'no_create': True, 'no_create_edit':True,'no_open': True}"/>
|
<field name="new_members_id" attrs="{'invisible': [('record_type', '=', 'donation')], 'required': [('record_type', '=', 'sponsorship')]}" options="{'no_create': True, 'no_create_edit':True,'no_open': True}" context="{'group_by': 'benefit_group'}"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<group string="Replacement Reason">
|
<group string="Replacement Reason">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue