From 5114d9aa7e68d64d5a9fbc941a175e0d7c32f3f4 Mon Sep 17 00:00:00 2001 From: Mohamed Eltayar Date: Wed, 12 Nov 2025 03:35:11 +0300 Subject: [PATCH] fix: module icon + sponsor phone visibility logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Changes:** 1. Module Icon Fix - Changed 'images' key to 'icon' in __manifest__.py - Removed list brackets (icon value is string, not list) - Now icon will display correctly in Apps menu - Path: static/description/icon5.png 2. Sponsor Phone Field Visibility - Added 'invisible' attrs to sponsor_phone field - Field now ONLY visible for 'unknown' (فاعل خير) type - Hidden for 'registered' and 'new_sponsor' types - Reason: sponsor_id Many2one already displays phone number - Prevents duplicate phone display in form **Field Behavior After Fix:** | Sponsor Type | sponsor_id Field | sponsor_phone Field | |--------------|------------------|---------------------| | مشترك بالنظام | ✅ Visible (shows name + phone) | ❌ Hidden | | مشترك جديد | ✅ Visible (shows name + phone) | ❌ Hidden | | فاعل خير | ❌ Hidden | ✅ Visible & Editable | **Technical Details:** XML attrs for sponsor_phone: ```xml 'invisible': ['|', '&', ('record_type','=','donation'), ('sponsor_or_donor_type','!=','unknown'), '&', ('record_type','=','sponsorship'), ('sponsor_donor_type','!=','unknown') ], 'readonly': [('state','!=','draft')] ``` Logic: - Invisible if: (donation AND NOT unknown) OR (sponsorship AND NOT unknown) - Visible only when: unknown (فاعل خير) type selected - Editable only in draft state **User Experience:** - No more duplicate phone number display - Cleaner form layout - Phone field only appears when actually needed (unknown sponsor) - Module icon now displays correctly Odoo 14 Compatible. XML validated. Synced with latest dev_odex25_ensan on Wed Nov 12 03:35:11 +03 2025 --- odex25_ensan/odex_takaful/__manifest__.py | 2 +- .../odex_takaful/views/takaful_sponorship_view.xml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/odex25_ensan/odex_takaful/__manifest__.py b/odex25_ensan/odex_takaful/__manifest__.py index e4524fb81..93c14dc4e 100644 --- a/odex25_ensan/odex_takaful/__manifest__.py +++ b/odex25_ensan/odex_takaful/__manifest__.py @@ -77,7 +77,7 @@ 'reports/transfer_deduction_report.xml', 'reports/transfer_deduction_report_templates.xml', ], - 'images': ['static/description/icon5.png'], + 'icon': 'static/description/icon5.png', # 'installable': True, # 'application': True, # 'auto_install': False, diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index c799f0383..891e9881a 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -192,12 +192,11 @@