[UPD] odex_takaful
This commit is contained in:
parent
c1e6eba628
commit
3836301242
|
|
@ -52,6 +52,7 @@
|
|||
<th>Sponsor Account Number</th>
|
||||
<th>Payment Method</th>
|
||||
<th>Donation Type</th>
|
||||
<th>Donation Name</th>
|
||||
<th>Direct Debit Start</th>
|
||||
<th>Direct Debit End</th>
|
||||
<th>Donation Date</th>
|
||||
|
|
@ -74,6 +75,7 @@
|
|||
<td><span t-esc="line.get('sponsor_account_number')"/></td>
|
||||
<td><span t-esc="line.get('payment_method_name')"/></td>
|
||||
<td><span t-esc="line.get('donation_type')"/></td>
|
||||
<td><span t-esc="line.get('donation_name')"/></td>
|
||||
<td><span t-esc="line.get('direct_debit_start_date')" t-options="{'widget': 'date'}"/></td>
|
||||
<td><span t-esc="line.get('direct_debit_end_date')" t-options="{'widget': 'date'}"/></td>
|
||||
<td><span t-esc="line.get('donation_date')" t-options="{'widget': 'date'}"/></td>
|
||||
|
|
|
|||
|
|
@ -195,6 +195,20 @@
|
|||
<field name="category_id" ref="module_category_kufula"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_kufula_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="responsible_user_sponsorship_access" model="ir.rule">
|
||||
<field name="name">Responsible Users can access related Sponsorships</field>
|
||||
<field name="model_id" ref="model_takaful_sponsorship"/>
|
||||
<field name="groups" eval="[(4, ref('group_kufula_user'))]"/>
|
||||
<field name="domain_force">
|
||||
[('sponsor_id.responsible_user_ids', 'in', [user.id])]
|
||||
</field>
|
||||
<field name="perm_read" eval="1"/>
|
||||
<field name="perm_write" eval="1"/>
|
||||
<field name="perm_create" eval="1"/>
|
||||
<field name="perm_unlink" eval="1"/>
|
||||
</record>
|
||||
|
||||
<record id="sponsorship_system_manager_restrictions" model="ir.rule">
|
||||
<field name="name">Sponsorship System Manager can see everything and settings</field>
|
||||
<field name="model_id" ref="model_takaful_sponsorship"/>
|
||||
|
|
@ -206,18 +220,6 @@
|
|||
<field name="perm_unlink" eval="1"/>
|
||||
</record>
|
||||
|
||||
<record id="responsible_user_sponsorship_access" model="ir.rule">
|
||||
<field name="name">Responsible Users can access related Sponsorships</field>
|
||||
<field name="model_id" ref="model_takaful_sponsorship"/>
|
||||
<field name="domain_force">
|
||||
[('sponsor_id.responsible_user_ids', 'in', [user.id])]
|
||||
</field>
|
||||
<field name="perm_read" eval="1"/>
|
||||
<field name="perm_write" eval="1"/>
|
||||
<field name="perm_create" eval="1"/>
|
||||
<field name="perm_unlink" eval="1"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@
|
|||
|
||||
<group name="group_right">
|
||||
<field name="sponsorship_creation_date" readonly="1"/>
|
||||
<field name="create_uid" string="Sponsorship Creator" readonly="1"/>
|
||||
<!-- <field name="sponsor_note" />-->
|
||||
<!-- <div attrs="{'invisible': [('sponsorship_type', '!=', 'person')]}">-->
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class TransferDeductionWizard(models.TransientModel):
|
|||
payment_method_id = fields.Many2one(
|
||||
'takaful.payment.method',
|
||||
string="Payment Method",
|
||||
domain="[('payment_method', 'in', ['bank_transfer', 'direct_debit'])]"
|
||||
)
|
||||
sponsor_ids = fields.Many2many(
|
||||
'takaful.sponsor',
|
||||
|
|
@ -65,6 +66,8 @@ class TransferDeductionWizard(models.TransientModel):
|
|||
|
||||
pdl_domain = self._get_data_domain()
|
||||
initial_pdls = self.env['payment.details.lines'].sudo().search(pdl_domain)
|
||||
if not self.env.user.has_group("odex_takaful.sponsorship_system_manager_group"):
|
||||
initial_pdls = initial_pdls.filtered(lambda r: self.env.user.id in r.sponsorship_id.sponsor_id.responsible_user_ids.ids)
|
||||
|
||||
if not initial_pdls:
|
||||
return []
|
||||
|
|
@ -76,23 +79,23 @@ class TransferDeductionWizard(models.TransientModel):
|
|||
for pdl_with_multiple_ssl in initial_pdls.filtered(lambda r: hasattr(r, 'sponsorship_scheduling_line_ids') and r.sponsorship_scheduling_line_ids):
|
||||
sponsorship_lines_from_pdls |= pdl_with_multiple_ssl.sponsorship_scheduling_line_ids
|
||||
|
||||
if sponsorship_lines_from_pdls:
|
||||
sponsorship_lines_from_pdls.mapped('beneficiary_id')
|
||||
sponsorship_ids = sponsorship_lines_from_pdls.mapped('sponsorship_id')
|
||||
if sponsorship_ids:
|
||||
sponsorship_ids.mapped('sponsor_id.name')
|
||||
sponsorship_ids.mapped('sponsor_id.mobile')
|
||||
sponsorship_ids.mapped('sponsor_id.branch_custom_id')
|
||||
sponsorship_ids.mapped('create_uid')
|
||||
sponsorship_ids.mapped('branch_custom_id')
|
||||
# if sponsorship_lines_from_pdls:
|
||||
# sponsorship_lines_from_pdls.mapped('beneficiary_id')
|
||||
# sponsorship_ids = sponsorship_lines_from_pdls.mapped('sponsorship_id').sudo()
|
||||
# if sponsorship_ids:
|
||||
# sponsorship_ids.mapped('sponsor_id.name')
|
||||
# sponsorship_ids.mapped('sponsor_id.mobile')
|
||||
# sponsorship_ids.mapped('sponsor_id.branch_custom_id')
|
||||
# sponsorship_ids.mapped('create_uid')
|
||||
# sponsorship_ids.mapped('branch_custom_id')
|
||||
|
||||
donation_details_ids = sponsorship_lines_from_pdls.mapped('donation_detail_linked_id')
|
||||
if donation_details_ids:
|
||||
donation_details_ids.mapped('payment_method_id')
|
||||
# donation_details_ids = sponsorship_lines_from_pdls.mapped('donation_detail_linked_id')
|
||||
# if donation_details_ids:
|
||||
# donation_details_ids.mapped('payment_method_id')
|
||||
|
||||
if initial_pdls:
|
||||
initial_pdls.mapped('bank_id')
|
||||
initial_pdls.mapped('charity_bank_id')
|
||||
# if initial_pdls:
|
||||
# initial_pdls.mapped('bank_id')
|
||||
# initial_pdls.mapped('charity_bank_id')
|
||||
|
||||
processed_lines_data = []
|
||||
|
||||
|
|
@ -144,6 +147,7 @@ class TransferDeductionWizard(models.TransientModel):
|
|||
'charity_bank_name': pdl.charity_bank_id.name if pdl.charity_bank_id else '',
|
||||
'sponsor_account_number': f'SA{pdl.sponsor_account_number}' if pdl.sponsor_account_number else '',
|
||||
|
||||
'donation_name': donation_detail.donation_name.name if donation_detail and donation_detail.donation_name else '',
|
||||
'payment_method_name': donation_detail.payment_method_id.name if donation_detail and donation_detail.payment_method_id else '',
|
||||
'donation_type': donation_detail.donation_type if donation_detail and hasattr(donation_detail, 'donation_type') else '',
|
||||
'direct_debit_start_date': pdl.direct_debit_start_date,
|
||||
|
|
|
|||
Loading…
Reference in New Issue