diff --git a/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py b/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py index 713f5a920..a73d2a5e2 100644 --- a/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py +++ b/odex25_ensan/odex_takaful/models/takaful_sponorship_model.py @@ -69,7 +69,7 @@ class TakafulSponsorship(models.Model): sponsor_note = fields.Text(string='Sponsor Note') sponsor_or_donor_type = fields.Selection(string='Sponsor / Donor Type',selection=[('registered', 'Registered'), ('new_sponsor', 'New Sponsor'), ('unknown', 'Unknown')], required=True, default='registered') # ('not_registered', 'Not Registered'), - sponsor_donor_type = fields.Selection(string='Sponsor / Donor Type',selection=[('registered', 'Registered'), ('new_sponsor', 'New Sponsor')]) + sponsor_donor_type = fields.Selection(string='Sponsor / Donor Type',selection=[('registered', 'Registered'), ('new_sponsor', 'New Sponsor')], default='registered') sponsor_name = fields.Char(string="Sponsor Name") sponsor_phone = fields.Char(string="Sponsor Phone", compute='_compute_sponsor_phone', store=True, readonly=False) sponsor_title = fields.Many2one('res.partner.title',string='Sponsor Title') diff --git a/odex25_ensan/odex_takaful/views/assets.xml b/odex25_ensan/odex_takaful/views/assets.xml index 26afaa7ae..9937e7660 100644 --- a/odex25_ensan/odex_takaful/views/assets.xml +++ b/odex25_ensan/odex_takaful/views/assets.xml @@ -127,6 +127,12 @@ font-size: 16px; } + .mechanism_option span { + min-width: 90px; + display: inline-block; + text-align: center; + } + .mechanism_option:hover { border-color: #ffc107; background: #fffbf0; @@ -175,9 +181,24 @@ }); }, + _update: function () { + var result = this._super.apply(this, arguments); + if (this.mode === 'edit' && this.modelName === 'takaful.sponsorship') { + var self = this; + setTimeout(function() { + self._setupSimpleUI(); + }, 50); + } + return result; + }, + _setupSimpleUI: function () { var self = this; + // Remove old event handlers to prevent duplicates + this.$('.record_option').off('click'); + this.$('.mechanism_option').off('click'); + // Record Type Options - Odoo 14 Compatible Method this.$('.record_option').on('click', function () { var $option = $(this); diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index 6177cf884..82a51a2b4 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -148,41 +148,62 @@