Merge pull request #4382 from expsa/revert-4381-eltayar

Revert "Fixed QWeb template inheritance error - removed non-existent template…"
This commit is contained in:
Mohamed Eltayar 2025-08-28 17:53:46 +03:00 committed by GitHub
commit 2899d07762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 40 deletions

View File

@ -3,11 +3,11 @@
Enhanced Hijri Datepicker Template for Odoo 14
Seamlessly integrates with Odoo's standard datepicker template structure
Maintains all Hijri functionality while following Odoo's UI patterns
Fixed template inheritance for Odoo 14 compatibility - removed non-existent templates
Fixed placeholder display for both Gregorian and Hijri fields
-->
<templates id="template" xml:space="preserve">
<!-- Main datepicker template extension - the only template that exists in Odoo 14 -->
<!-- Main datepicker template extension -->
<t t-name="web.datepicker" t-extend="web.datepicker">
<t t-jquery=".o_datepicker" t-operation="replace">
<div class="o_datepicker input-group"
@ -19,7 +19,7 @@
<input type="text"
class="o_datepicker_input o_input form-control datetimepicker-input"
t-att-name="widget.name"
placeholder="التاريخ الميلادي (مم/يي/سسسس)"
placeholder="التاريخ الميلادي"
t-attf-data-target="##{datepickerID}"
autocomplete="off"
t-att-readonly="widget.readonly ? 'readonly' : null"/>
@ -42,7 +42,7 @@
<input type="text"
class="o_hijri o_input form-control"
t-att-name="widget.name + '_hijri'"
placeholder="التاريخ الهجري (الشهر اليوم، السنة)"
placeholder="التاريخ الهجري"
readonly="readonly"
style="background-color: rgba(40, 167, 69, 0.1); border-color: rgba(40, 167, 69, 0.2); color: #28a745;"
title="مكافئ التاريخ الهجري"
@ -57,8 +57,13 @@
</span>
</div>
</div>
<!-- Hijri readonly display for form views - integrated directly -->
</t>
</t>
<!-- Enhanced date widget template for form views -->
<t t-name="web.DateWidget" t-extend="web.DateWidget">
<t t-jquery=".o_datepicker" t-operation="after">
<!-- Hijri date display in readonly mode -->
<div class="o_hijri_readonly d-none" style="margin-top: 0.25rem;">
<small class="text-muted">
<i class="fa fa-calendar-alt text-success mr-1" aria-hidden="true"/>
@ -69,44 +74,25 @@
</t>
</t>
<!-- List view date cell template enhancement -->
<t t-name="ListView.row" t-extend="ListView.row">
<t t-jquery="td[t-att-class*='o_data_cell']" t-operation="attributes">
<t t-att-data-hijri-enabled="widget.type === 'date' ? 'true' : null"/>
</t>
</t>
<!-- Form view date field template enhancement -->
<t t-name="FieldDate" t-extend="FieldDate">
<t t-jquery=".o_field_date" t-operation="attributes">
<t t-att-data-hijri-supported="true"/>
</t>
</t>
<!-- Accessibility enhancements for screen readers -->
<t t-name="web.hijri_accessibility">
<t t-name="web.datepicker.hijri_accessibility">
<div class="sr-only" aria-live="polite" id="hijri_announce">
<!-- Screen reader announcements for Hijri date changes -->
</div>
</t>
<!-- Hijri date display template for standalone use -->
<t t-name="hijri_date_display">
<div class="hijri-date-container">
<div class="gregorian-date" t-esc="gregorian_date"/>
<div class="hijri-date text-success" t-if="hijri_date">
<small>
<i class="fa fa-calendar-alt mr-1"/>
التاريخ الهجري: <span t-esc="hijri_date"/>
</small>
</div>
</div>
</t>
<!-- Hijri picker popup template for advanced customization -->
<t t-name="hijri_picker_popup">
<div class="hijri-picker-popup">
<div class="picker-header">
<h6 class="mb-0">اختيار التاريخ الهجري</h6>
</div>
<div class="picker-body">
<!-- Calendar will be inserted here by JavaScript -->
</div>
<div class="picker-footer">
<button type="button" class="btn btn-sm btn-secondary hijri-cancel">
إلغاء
</button>
<button type="button" class="btn btn-sm btn-primary hijri-today">
اليوم
</button>
</div>
</div>
</t>
</templates>