FIX customer Notes 7 addition

This commit is contained in:
Nossibaelhadi 2025-11-10 01:06:27 +03:00
parent 33b85ab655
commit 8b4f9caf9c
5 changed files with 21 additions and 16 deletions

View File

@ -2337,7 +2337,7 @@ msgstr "الاسر المستفيدة"
#: model:ir.model.fields,field_description:odex_takaful.field_replacement_process__family_ids
#: model:ir.model.fields,field_description:odex_takaful.field_takaful_sponsorship__family_id
msgid "Family"
msgstr "عائلة"
msgstr "ملف الاسرة"
#. module: odex_takaful
#: model:ir.model.fields,field_description:odex_takaful.field_replacement_wiz__family_category_ids

View File

@ -110,8 +110,8 @@ class DonationsDetailsLines(models.Model):
def _compute_replacement_count(self):
for rec in self:
rec.replacement_count = len(rec.replacement_log_ids)
if self.benefit_status == 'non_benefit':
self.state = 'replace'
# if self.benefit_status == 'non_benefit':
# self.state = 'replace'
@api.depends('sponsorship_id', 'sponsorship_mechanism_id')
def _compute_sponsor_id(self):
@ -193,7 +193,7 @@ class DonationsDetailsLines(models.Model):
for rec in self:
rec.total_months_amount = rec.donation_amount * rec.payment_month_count
@api.onchange('benefit_id')
@api.onchange('benefit_id','benefit_ids')
def _onchange_benefit_id(self):
for rec in self:
if rec.benefit_id:
@ -754,6 +754,8 @@ class DonationsDetailsLines(models.Model):
})
record = super(DonationsDetailsLines, self).create(vals)
if record.benefit_ids == 1:
record.benefit_id = record.benefit_ids[0].id
return record
@ -803,9 +805,9 @@ class DonationsDetailsLines(models.Model):
message = _("Benefit IDs changed in a donation item:<br/>%s") % "<br/>".join(changes)
sponsorship.message_post(body=message)
self.onset_benefit_id()
# if self.benefit_id:
# if self.benefit_status and self.benefit_status == 'non_benefit':
# self.state = 'replace'
if self.benefit_id:
if self.benefit_status and self.benefit_status == 'non_benefit':
self.state = 'replace'
return res
def action_view_replacement_wizard(self):

View File

@ -1198,6 +1198,8 @@ class TakafulSponsorship(models.Model):
'donation_mechanism': 'with_conditions',
}
new_line = self.env['donations.details.lines'].sudo().create(new_vals)
elif line.benefit_ids == 1:
line.benefit_id = line.benefit_ids[0].id
all_donation_lines = (self.donations_details_lines + self.donations_details_lines_mechanism_ids).filtered(
lambda r: r.display_type == False)

View File

@ -126,7 +126,7 @@
name="action_view_replacement_wizard"
type="object"
class="btn-primary"
attrs="{'invisible': ['|', '&amp;',('state', 'not in', ['active', 'paid']), ('record_type', '=', 'donation'), ('donation_mechanism', '=', 'without_conditions')]}"
attrs="{'invisible': ['|', '&amp;',('state', 'not in', ['active', 'paid', 'replace']), ('record_type', '=', 'donation'), ('donation_mechanism', '=', 'without_conditions')]}"
groups="odex_takaful.group_orphan_replacement" />
<button string="Replace Sponsor"
name="replace_sponsor_wizard"

View File

@ -43,12 +43,13 @@
<button string="Pay All Sponsorships" name="action_register_payment" type="object"
class="oe_highlight"
attrs="{'invisible': ['|', ('state', 'not in', ['confirmed', 'wait_pay','under_replacement','replacement_done']), ('show_register_payment', '=', False)]}"/>
<button name="action_reset_to_draft" type="object"
string="Reset to Draft" class="btn-link"
attrs="{'invisible': [('state','!=','confirmed')]}"/>
<button name="action_set_cancel" type="object"
string="To Cancel" class="oe_highlight"
attrs="{'invisible': [('state','not in',['confirmed'])]}"/>
<button name="action_reset_to_draft" type="object"
string="Reset to Draft" class="btn-link"
attrs="{'invisible': [('state','!=','confirmed')]}"/>
<button name="action_set_close" type="object"
string="Close" class="oe_highlight"
attrs="{'invisible': [('state', 'not in', ['wait_pay', 'paid'])]}"/>
@ -78,9 +79,9 @@
<field name="refund_move_count" string="Refund Invoices"
widget="statinfo"/>
</button>
<button name="action_replacement_processes" type="object"
string="Replacement Processes" class="oe_stat_button" icon="fa-users">
</button>
<!-- <button name="action_replacement_processes" type="object"-->
<!-- string="Replacement Processes" class="oe_stat_button" icon="fa-users">-->
<!-- </button>-->
</div>
<h1>
<field name="code" nolabel="1"/>
@ -191,8 +192,8 @@
<tree editable="bottom">
<control>
<create name="add_line_control" string="Add a line"/>
<create name="add_section_control" string="Add a section"
context="{'default_display_type': 'line_section'}"/>
<!-- <create name="add_section_control" string="Add a section"-->
<!-- context="{'default_display_type': 'line_section'}"/>-->
<!-- <button name="action_delegate_to_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'sponsorship_id': parent.id}"/>-->
</control>
<field name="sponsorship_duration" invisible="1"/>