Merge pull request #5358 from expsa/fix/comprehensive-ui-fixes-20251111-2330

🎯 Comprehensive UI Fixes - Translations, Defaults, Layout & UX
This commit is contained in:
Mohamed Eltayar 2025-11-12 00:03:48 +03:00 committed by GitHub
commit 0a19a0489f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 37 additions and 17 deletions

View File

@ -67,7 +67,7 @@ class TakafulSponsorship(models.Model):
branch_custom_id = fields.Many2one('branch.settings', string="Branch", default=lambda self: self._default_branch_custom_id(), required=True, tracking=True)
sponsorship_creation_date = fields.Datetime(string="Sponsorship Creation Date", default=fields.Datetime.now, required=True, copy=False)
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)
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_name = fields.Char(string="Sponsor Name")

View File

@ -29,6 +29,12 @@
direction: ltr;
}
/* Fix top spacing caused by h1 */
h1 {
margin-bottom: 5px !important;
margin-top: 5px !important;
}
/* Record Type Simple & Clean Design */
.o_record_type_simple {
background: #f8f9fa;
@ -111,7 +117,14 @@
display: flex;
align-items: center;
gap: 8px;
min-width: 100px;
min-width: 120px;
justify-content: center;
}
.mechanism_option i {
width: 20px;
text-align: center;
font-size: 16px;
}
.mechanism_option:hover {
@ -210,6 +223,9 @@
var currentMechanism = self.model.localData[self.handle].data.donation_mechanism;
if (currentMechanism) {
self.$('.mechanism_option[data-value="' + currentMechanism + '"]').addClass('selected');
} else {
// Default to without_conditions (غير مشروط) as requested
self.$('.mechanism_option[data-value="without_conditions"]').addClass('selected');
}
}, 100);
}

View File

@ -92,11 +92,11 @@
<div class="record_type_options">
<div class="record_option donation_option" data-value="donation">
<i class="fa fa-heart"></i>
<span>Donation</span>
<span>تبرع</span>
</div>
<div class="record_option sponsorship_option" data-value="sponsorship">
<i class="fa fa-users"></i>
<span>Sponsorship</span>
<span>كفالة</span>
</div>
</div>
@ -113,12 +113,12 @@
attrs="{'invisible': [('record_type','!=','donation')]}">
<div class="mechanism_options">
<div class="mechanism_option without_conditions" data-value="without_conditions">
<i class="fa fa-gift"></i>
<span>Unconditional</span>
<i class="fa fa-check-circle"></i>
<span>غير مشروط</span>
</div>
<div class="mechanism_option with_conditions" data-value="with_conditions">
<i class="fa fa-list-check"></i>
<span>Conditional</span>
<i class="fa fa-list-alt"></i>
<span>مشروط</span>
</div>
</div>
@ -152,9 +152,9 @@
<field name="sponsor_donor_type"
attrs="{'invisible': [('record_type','!=','sponsorship')], 'readonly': [('state','!=','draft')]}"/>
<button name="create_new_sponsor" type="object"
string="إنشاء كافل/متبرع جديد"
string="إنشاء مشترك"
class="btn-primary oe_highlight"
icon="fa-plus-circle"
icon="fa-plus"
attrs="{
'invisible': [
'|','|',('sponsor_id','!=',False),
@ -176,9 +176,13 @@
attrs="{'invisible': [('sponsor_id','=',False), ('sponsor_or_donor_type','!=','registered')]}"
force_save="1" options="{'no_create': True, 'no_create_edit': True}"/>
<field name="sponsor_phone" widget="phone"
<field name="sponsor_phone" string="رقم الجوال" widget="phone"
attrs="{'invisible': [('sponsor_or_donor_type','=', False)], 'readonly': [('sponsor_or_donor_type', '!=', 'unknown')]}"
placeholder="05xxxxxxxx" help="Saudi mobile number format"/>
<field name="preferred_communication"
attrs="{'invisible': ['|', ('sponsor_or_donor_type','!=','new_sponsor'), ('record_type','!=','donation')], 'required': [('sponsor_or_donor_type','=','new_sponsor')]}"
force_save="1" options="{'no_create': True, 'no_create_edit': True}"/>
</group>
<group name="group_right" string="Basic Information">

View File

@ -81,11 +81,11 @@
<group attrs="{'invisible': [('company_type', '!=', 'person')]}">
<div class="o_row">
<field placeholder="Title" name="title" class="oe_inline" nolabel="1"
<field placeholder="اللقب" name="title" class="oe_inline" nolabel="1" style="width: 20%;"
domain="[('position', 'in', ['prefix','both'])]"
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
<field placeholder="Name" name="first_name" class="oe_inline" nolabel="1"/>
<field placeholder="Suffix Title" name="suffix_title_id" class="oe_inline" nolabel="1"
<field placeholder="الاسم" name="first_name" class="oe_inline" nolabel="1" style="width: 60%;"/>
<field placeholder="العبارة الختامية" name="suffix_title_id" class="oe_inline" nolabel="1" style="width: 20%;"
domain="[('position', 'in', ['suffix','both'])]"
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
</div>
@ -93,8 +93,8 @@
<group name="group_top">
<group name="group_left">
<field name="mobile" attrs="{'required': [('parent_id', '=', False)]}"/>
<field name="id_number" attrs="{'invisible': [('company_type', '!=', 'person')]}"/>
<field name="mobile" string="رقم الجوال" widget="phone" placeholder="05xxxxxxxx" attrs="{'required': [('parent_id', '=', False)]}"/>
<field name="preferred_communication" string="طريقة التواصل المفضلة" required="1"/>
<field name="gender" attrs="{'required': [('company_type', '=', 'person')],'invisible': [('company_type', '!=', 'person')]}"/>
<field name="street" attrs="{'invisible': [('company_type', '=', 'person')]}"/>
<field name="zip" attrs="{'invisible': [('company_type', '=', 'person')]}"/>
@ -107,7 +107,7 @@
<field name="city_id"/>
<field name="branch_custom_id"/>
<field name="district_id" invisible="1"/>
<field name="preferred_communication" required="1"/>
<field name="id_number" attrs="{'invisible': [('company_type', '!=', 'person')]}"/>
<!-- <field name="journal_id"/> -->
<!-- <label for="account_number" string="Bank Account"/>
<div class="o_address_format">