From d0b8b35489ab4d8cea16261f73a3ac0b78e50880 Mon Sep 17 00:00:00 2001 From: odoo-syria-team Date: Tue, 18 Nov 2025 13:41:26 +0300 Subject: [PATCH 1/3] [ADD] Replace and add fields in Donation --- odex25_ensan/odex_takaful/i18n/ar_001.po | 5 + .../models/donation_details_lines.py | 42 ++++ .../views/donations_details_lines.xml | 12 +- .../views/takaful_menus_actions.xml | 14 +- .../views/takaful_sponorship_view.xml | 1 + .../wizards/account_payment_register.py | 10 +- .../wizards/account_payment_register.xml | 180 +++++++++--------- 7 files changed, 167 insertions(+), 97 deletions(-) diff --git a/odex25_ensan/odex_takaful/i18n/ar_001.po b/odex25_ensan/odex_takaful/i18n/ar_001.po index 926fbccd8..597609a79 100644 --- a/odex25_ensan/odex_takaful/i18n/ar_001.po +++ b/odex25_ensan/odex_takaful/i18n/ar_001.po @@ -243,6 +243,11 @@ msgstr "تاريخ الدفع:" msgid "Payment Method:" msgstr "طريقة الدفع:" +#. module: enasan_geidea_sponsorship +#: model_terms:ir.ui.view,arch_db:enasan_geidea_sponsorship.view_account_payment_register_form_geidea +msgid "Process on Terminal" +msgstr "الدفع على المنصة" + #. module: odex_takaful #: model_terms:ir.ui.view,arch_db:odex_takaful.report_transfer_deduction_document msgid "Payment Method" diff --git a/odex25_ensan/odex_takaful/models/donation_details_lines.py b/odex25_ensan/odex_takaful/models/donation_details_lines.py index e600b2a65..ca9877efa 100644 --- a/odex25_ensan/odex_takaful/models/donation_details_lines.py +++ b/odex25_ensan/odex_takaful/models/donation_details_lines.py @@ -99,6 +99,34 @@ class DonationsDetailsLines(models.Model): journal_id = fields.Many2one('account.journal', string="Journal",domain="[('type','=','bank')]",default=_default_journal_id) benefit_status = fields.Selection(related='benefit_id.member_status') ages = fields.Integer(compute='_compute_get_age_range' , store=True) + waiting_date = fields.Date( + string="تاريخ الانتظار", + compute="_compute_dates", + store=True + ) + + replace_date = fields.Date( + string="تاريخ الاستبدال", + compute="_compute_dates", + store=True + ) + + @api.depends('state') + def _compute_dates(self): + """Automatically set waiting_date or replace_date based on state.""" + for rec in self: + if rec.state == 'waiting': + print(date.today()) + rec.waiting_date = date.today() + rec.replace_date = False + elif rec.state == 'replace': + rec.replace_date = date.today() + rec.waiting_date = False + else: + rec.waiting_date = False + rec.replace_date = False + + # cheque_number = fields.Integer(string="Cheque Number") # cheque_due_date = fields.Date(string="Cheque Due Date") # cheque_file_attachment = fields.Binary(string='Cheque Attachment', attachment=True) @@ -864,6 +892,20 @@ class DonationsDetailsLines(models.Model): if sponsorship and len(sponsorship) == 1: message = _("Benefit IDs changed in a donation item:
%s") % "
".join(changes) sponsorship.message_post(body=message) + + # if 'state' in vals: + # print('In Vals') + # print("vals['state'] >>> " , vals['state']) + # if vals['state'] == 'waiting': + # vals['waiting_date'] = date.today() + # print("vals['waiting_date'] >>> " , vals['waiting_date']) + # vals['replace_date'] = False + # elif vals['state'] == 'replace': + # vals['replace_date'] = date.today() + # vals['waiting_date'] = False + # else: + # vals['waiting_date'] = False + # vals['replace_date'] = False self.onset_benefit_id() return res diff --git a/odex25_ensan/odex_takaful/views/donations_details_lines.xml b/odex25_ensan/odex_takaful/views/donations_details_lines.xml index 5582f6347..1268e2518 100644 --- a/odex25_ensan/odex_takaful/views/donations_details_lines.xml +++ b/odex25_ensan/odex_takaful/views/donations_details_lines.xml @@ -61,11 +61,12 @@ donations.details.lines.view.tree donations.details.lines - + + @@ -84,6 +85,8 @@ + + + @@ -362,16 +366,18 @@ Donations Details Lines waiting donations.details.lines tree,form + [('state', '=', 'waiting')] - {'create': False, 'delete': False, 'search_default_filter_waiting': 1} + {'create': False, 'delete': False} Donations Details Lines Replacement donations.details.lines tree,form + [('state', '=', 'replace')] - {'create': False, 'delete': False, 'search_default_filter_replace': 1} + {'create': False, 'delete': False} diff --git a/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml b/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml index 79ff0230d..705849407 100644 --- a/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml +++ b/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml @@ -13,11 +13,13 @@ - - + name="Donations Details Lines To Replace Benefit" action="donations_details_lines_replace_action" sequence="3"/> + + + + @@ -27,7 +29,7 @@ - - \ No newline at end of file + diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index 56a65fc41..a79347f7f 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -514,6 +514,7 @@ + - - - + + + - {'readonly':[('is_refund_sponsorship','=',True)]} + + {'readonly': [('is_refund_sponsorship', '=', True)]} + Association Journal - context.get('sponsorship_payment') @@ -25,7 +26,7 @@ context.get('sponsorship_payment') - + context.get('sponsorship_payment') @@ -35,94 +36,99 @@ - + - + - + - - - + + + + filename="transaction_attachment_file_name" + attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','not in',['bank', 'check'])], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','bank')]}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ebed704f3644f6d2987b46272a90537bdede6215 Mon Sep 17 00:00:00 2001 From: odoo-syria-team Date: Wed, 19 Nov 2025 09:43:48 +0300 Subject: [PATCH 2/3] [ADD] Replace and add fields in Donation --- odex25_ensan/odex_takaful/models/res_partner.py | 8 ++++++++ odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/odex25_ensan/odex_takaful/models/res_partner.py b/odex25_ensan/odex_takaful/models/res_partner.py index dddf7dc1a..4167b994d 100644 --- a/odex25_ensan/odex_takaful/models/res_partner.py +++ b/odex25_ensan/odex_takaful/models/res_partner.py @@ -281,6 +281,14 @@ class ResPartner(models.Model): if 'mobile' in vals: self._check_phone_numbers(vals['mobile']) vals['mobile'] = self.phone_format(vals['mobile']) + if 'name' in vals : + if self.kafel_id: + self.kafel_id.name = vals['name'] + + if 'mobile' in vals : + if self.kafel_id: + self.kafel_id.login = vals['mobile'] + res = super(ResPartner, self).write(vals) return res diff --git a/odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml index 70a4fd5aa..92a007b26 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml @@ -94,7 +94,7 @@ - + From 6bbfce877faec221d6f0321c00b35999d0a2bb3a Mon Sep 17 00:00:00 2001 From: odoo-syria-team Date: Wed, 19 Nov 2025 11:29:40 +0300 Subject: [PATCH 3/3] [FIX] Edit and invisible fields --- odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml | 2 +- odex25_ensan/odex_takaful/views/takaful_sponsor_view.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index a79347f7f..0a48459e1 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -514,7 +514,7 @@ - + + - +