From c537eb836dc1eef7614d6047d2904de74ef32357 Mon Sep 17 00:00:00 2001 From: Mohamed Eltayar <152964073+maltayyar2@users.noreply.github.com> Date: Sun, 31 Aug 2025 23:54:18 +0300 Subject: [PATCH] Revert "enhance_sar_symbol" --- odex25_base/am_sar_symbol/readme.txt | 11 +- .../am_sar_symbol/static/src/css/style.css | 248 ++++++++++++------ 2 files changed, 164 insertions(+), 95 deletions(-) diff --git a/odex25_base/am_sar_symbol/readme.txt b/odex25_base/am_sar_symbol/readme.txt index df6132265..80b26070d 100644 --- a/odex25_base/am_sar_symbol/readme.txt +++ b/odex25_base/am_sar_symbol/readme.txt @@ -1,9 +1,2 @@ -After installing this module, copy the Saudi Riyal symbol below and paste it in the currency symbol field for the Saudi Riyal (SAR) currency in: Accounting > Configuration > Accounting > Currencies. - -**Copy this symbol:** - -**الرمز للنسخ:** - -Note: The symbol above should display as the new Saudi Riyal currency symbol. If you see a square or different character, please ensure the module is properly installed and the page is refreshed. - -ملاحظة: الرمز أعلاه يجب أن يظهر كرمز العملة السعودية الجديد. إذا رأيت مربعاً أو حرفاً مختلفاً، تأكد من أن الموديول مثبت بشكل صحيح وأن الصفحة محدثة. +After installing this module, copy the symbol () and paste it in the currency symbol field +for the Saudi Riyal (SAR) currency in: Accounting > Configuration > Accounting > Currencies. diff --git a/odex25_base/am_sar_symbol/static/src/css/style.css b/odex25_base/am_sar_symbol/static/src/css/style.css index 7589f3f8d..1b1564e4b 100644 --- a/odex25_base/am_sar_symbol/static/src/css/style.css +++ b/odex25_base/am_sar_symbol/static/src/css/style.css @@ -1,4 +1,4 @@ -/* SAR Symbol Font Definition Only - No other font changes */ +/* SAR Symbol Font Definition */ @font-face { font-family: 'sar-symbol'; src: url('../fonts/sar-symbol.eot?ebwrxj'); @@ -11,113 +11,189 @@ font-display: block; } -/* SAR Icon Class */ -[class^="icon-sar"], [class*=" icon-sar"] { - font-family: 'sar-symbol' !important; - -webkit-font-feature-settings: 'liga'; - font-feature-settings: 'liga'; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; +/* إزالة التطبيق العام للفونت - هذا السبب في المشكلة الأصلية */ +/* + هذا السطر كان يغير فونت النظام كله: + *:not(.fa):not(.oi) { + font-family: 'Tajawal-Regular', 'sar-symbol', sans-serif !important; + } + تم حذفه نهائياً +*/ + +/* ========================================== + الحل الصحيح: تطبيق الفونت بشكل انتقائي + ========================================== */ + +/* 1. تعريف كلاس خاص لرمز العملة السعودية */ +.sar_currency_symbol, +.saudi_riyal_symbol, +[data-currency="SAR"], +[data-currency-code="SAR"] { + font-family: 'sar-symbol', inherit, sans-serif !important; } -.icon-sar:before { - content: "\e900"; +/* 2. تطبيق على الحقول النقدية المحددة */ +.o_field_monetary.sar_currency, +.o_field_monetary[data-currency="SAR"], +.oe_currency_value.sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* ============================================================ - إعدادات العملة - حقل الرمز في صفحة الإعدادات - ============================================================ */ - -/* حقل رمز العملة في إعدادات العملات */ -.o_form_view .o_field_char[name="symbol"], -.o_field_widget[name="symbol"], -.o_field_char[name="symbol"] input, -input[name="symbol"], -.o_form_view input[name="symbol"] { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 3. تطبيق على عناصر القوائم والجداول */ +.o_list_view .sar_currency, +.o_list_table .sar_currency, +table.o_list_table td.sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* إضافة دعم للحقول في موديل res.currency */ -.o_form_view[data-res-model="res.currency"] .o_field_char, -.o_form_view[data-res-model="res.currency"] input[type="text"] { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 4. تطبيق على عروض kanban */ +.o_kanban_view .sar_currency, +.oe_kanban_details .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* ============================================================ - الحل الأمثل: إضافة فونت sar-symbol للفونت الموجود بدون تغييره - ============================================================ */ - -/* تطبيق محدود - إضافة sar-symbol للفونت family الموجود */ -.o_field_monetary, -.oe_currency_value, -.o_field_widget[data-field-type="monetary"], -.monetary_field, -.currency_field, -.pos-receipt .price, -.pos-content .price, -.o_account_reports_table .o_account_report_column_value, -.o_list_view .o_data_cell[data-field-type="monetary"], -.o_kanban_view .oe_kanban_details .oe_kanban_monetary, -.product_price { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 5. التقارير المحاسبية */ +.o_account_reports_table .sar_currency, +.o_account_report_line .sar_currency, +.account_report .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* تطبيق على التقارير المطبوعة */ +/* 6. نقطة البيع */ +.pos-content .sar_currency, +.o_pos_order_line .sar_currency, +.pos-receipt .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +/* 7. الفواتير والتقارير المطبوعة */ +.o_report_layout_standard .sar_currency, +.o_report_layout_boxed .sar_currency, +.report .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +/* 8. قوائم الأسعار */ +.product_price.sar_currency, +.pricelist .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +/* 9. الحقول المحسوبة والمجاميع */ +.o_form_view .o_group .sar_currency, +.oe_subtotal_footer .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +/* 10. تطبيق خاص للطباعة */ @media print { - .o_field_monetary, - .oe_currency_value, - .monetary_field, - .currency_field, - .price { - font-family: inherit, 'sar-symbol', sans-serif !important; + .sar_currency, + [data-currency="SAR"], + .saudi_riyal_symbol { + font-family: 'sar-symbol', inherit, sans-serif !important; } } -/* تطبيق على عناصر التقارير */ -.o_report_layout_standard .price, -.o_report_layout_boxed .price, -.report .monetary, -.page .monetary { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 11. حقول البحث والفلاتر */ +.o_searchview .sar_currency, +.o_facet_values .sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* JavaScript Helper Classes */ -.js_has_sar_symbol, -.sar_currency { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 12. الويدجات المخصصة */ +.o_widget_monetary.sar_currency, +.monetary_field.sar_currency { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* Special handling for elements that contain SAR symbol */ -.contains_sar_symbol { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 13. تحسين عرض الرمز */ +.sar_currency_symbol::before { + font-family: 'sar-symbol' !important; + content: '\e900'; + margin-right: 3px; } -/* ============================================================ - دعم إضافي لصفحات الإعدادات والقوائم - ============================================================ */ - -/* قوائم العملات */ -.o_list_view[data-res-model="res.currency"] .o_data_cell, -.o_list_view[data-res-model="res.currency"] td { - font-family: inherit, 'sar-symbol', sans-serif !important; +/* 14. للاستخدام اليدوي في القوالب */ +.manual_sar_symbol { + font-family: 'sar-symbol', inherit, sans-serif !important; } -/* عرض kanban للعملات */ -.o_kanban_view[data-res-model="res.currency"] .oe_kanban_details { - font-family: inherit, 'sar-symbol', sans-serif !important; +.manual_sar_symbol::before { + content: '\e900'; + font-family: 'sar-symbol' !important; + margin-right: 2px; } -/* ============================================================ - ملاحظة مهمة: - الكود ده بيستخدم inherit علشان يحتفظ بالفونت الأصلي - للثيم المستخدم ويضيف بس فونت sar-symbol كـ fallback - للرمز الخاص بالعملة السعودية +/* ========================================== + JavaScript Helper Classes + هذه الكلاسات ستُطبق عبر JavaScript + ========================================== */ + +.js_has_sar_symbol { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +.js_currency_sar { + font-family: 'sar-symbol', inherit, sans-serif !important; +} + +/* ========================================== + ضمان عدم تأثير على باقي النظام + ========================================== */ + +/* التأكد من أن باقي النصوص تحتفظ بالفونت الأصلي */ +body, +.o_form_view, +.o_list_view, +.o_kanban_view, +input:not(.sar_currency), +textarea:not(.sar_currency), +select:not(.sar_currency), +.o_field_widget:not(.sar_currency), +.btn:not(.sar_currency) { + /* الاحتفاظ بالفونت الأصلي */ +} + +/* ========================================== + CRITICAL: JavaScript Integration Required + ========================================== */ + +/* + هذا الحل يتطلب JavaScript للعمل بفعالية: - تم إضافة دعم خاص لحقول الإعدادات علشان يظهر الرمز - في صفحة إعدادات العملة نفسها - ============================================================ */ \ No newline at end of file + 1. البحث عن العناصر التي تحتوي على رمز العملة السعودية + 2. إضافة كلاس 'sar_currency' أو 'js_has_sar_symbol' لها + 3. هذا سيضمن تطبيق الفونت الصحيح فقط على العناصر المطلوبة + + مثال JavaScript المطلوب: + + document.addEventListener('DOMContentLoaded', function() { + // البحث عن العناصر التي تحتوي على رمز الريال + const elements = document.querySelectorAll('*'); + elements.forEach(element => { + if (element.textContent && element.textContent.includes('﷼')) { + element.classList.add('js_has_sar_symbol'); + } + }); + + // مراقبة التغييرات في DOM + const observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + if (mutation.type === 'childList') { + mutation.addedNodes.forEach(function(node) { + if (node.nodeType === 1) { // Element node + if (node.textContent && node.textContent.includes('﷼')) { + node.classList.add('js_has_sar_symbol'); + } + } + }); + } + }); + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + }); +*/ \ No newline at end of file