From fa9f3e256286274c835584496f72809230f4e1fc Mon Sep 17 00:00:00 2001 From: Ali Ammar Date: Sun, 7 Dec 2025 11:27:25 +0300 Subject: [PATCH 1/2] [ADD] Edit the cron job --- .../odex_takaful/models/sponsorship_scheduling_line.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py b/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py index f6b2316b5..5b6abd620 100644 --- a/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py +++ b/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py @@ -96,14 +96,19 @@ class SchedulingLine(models.Model): scheduled_lines = self.search([ ('scheduled_date', '<=', today), ('status', '=', 'unpaid'), + ('sponsorship_state', 'not in', ['canceled', 'closed']), ]) - _logger.info(f"Found {len(scheduled_lines)} scheduling lines scheduled for {today}") - + for line in scheduled_lines: donation_line = line.donation_detail_linked_id sponsorship = donation_line.sponsorship_id or donation_line.sponsorship_mechanism_id + # Additional safety check: skip if sponsorship is canceled or closed + if not sponsorship or sponsorship.state in ['canceled', 'closed']: + _logger.warning(f"Skipping scheduled payment for line {line.sequence_no}: sponsorship state is {sponsorship.state if sponsorship else 'None'}") + continue + try: if line.donation_detail_linked_id.direct_debit: invoice_id = self.env['account.move'].sudo().search([ From 19df1118308cb7ea38e7f202fa2d4a0e63f2ce5f Mon Sep 17 00:00:00 2001 From: Ali Ammar Date: Sun, 7 Dec 2025 12:17:03 +0300 Subject: [PATCH 2/2] [FIX] ESTERDAD views --- .../odex_takaful/wizards/esterdad.xml | 109 +++++++++--------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/odex25_takaful/odex_takaful/wizards/esterdad.xml b/odex25_takaful/odex_takaful/wizards/esterdad.xml index c042eed62..8ea47e0c0 100644 --- a/odex25_takaful/odex_takaful/wizards/esterdad.xml +++ b/odex25_takaful/odex_takaful/wizards/esterdad.xml @@ -4,7 +4,7 @@ esterdad.wizard.tree esterdad.wizard - + @@ -20,63 +20,68 @@ esterdad.wizard
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - + + + + - - - - + + + + +
+
+
-