Merge pull request #4482 from expsa/eltayar

enhance_sar_symbol
This commit is contained in:
Mohamed Eltayar 2025-09-01 00:25:52 +03:00 committed by GitHub
commit 227a77904b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 111 additions and 35 deletions

View File

@ -1,34 +1,48 @@
{ {
'name': 'SAR Symbol Font | Saudi Currency Symbol | Riyal Saudi Icon', 'name': 'SAR Symbol Font | Saudi Currency Symbol | Riyal Saudi Icon',
'version': '14.0.2.0.0', 'version': '14.0.2.1.0',
'category': 'Accounting', 'category': 'Accounting',
'summary': 'Add the new Saudi Riyal (SAR) symbol to your Odoo system', 'summary': 'Add the new Saudi Riyal (SAR) symbol to your Odoo system with automatic setup',
'description': """ 'description': """
SAR Symbol Font for Odoo SAR Symbol Font for Odoo
رمز الريال السعودي اودو Odoo رمز الريال السعودي اودو Odoo
======================= =======================
This module adds the new Saudi Riyal () symbol to your Odoo system interfaces, including: This module adds the new Saudi Riyal (ر.س) symbol to your Odoo system interfaces, including:
* PDF Reports * PDF Reports
* Point of Sale Interface * Point of Sale Interface
* Invoices * Invoices
* All system views * All system views
* Automatic currency symbol update
After installing this module, copy the symbol () and paste it in the currency symbol field Features:
for the Saudi Riyal (SAR) currency in: Accounting > Configuration > Accounting > Currencies. =========
Automatic installation - no manual setup required
Compatible with custom themes (uses inherit fonts)
Clean implementation without font conflicts
Supports both Arabic and English interfaces
Note: Please ensure there are no other font-family customizations in your system views and invoices Installation:
that might conflict with this module. =============
Simply install the module and the Saudi Riyal symbol will be automatically
applied to your currency settings.
Technical Notes:
================
- Uses dedicated sar-symbol font for the new Saudi Riyal symbol
- Compatible with custom backend themes
- Optimized for performance and minimal conflicts
""", """,
'author': 'bst-inn, Amro00743', 'author': 'bst-inn, Amro00743, Expert SA',
"support": "amro00743@gmail.com", "support": "amro00743@gmail.com",
'website': 'https://www.linkedin.com/in/amro00743/', 'website': 'https://www.linkedin.com/in/amro00743/',
'license': 'LGPL-3', 'license': 'LGPL-3',
'price': 0.0, 'price': 0.0,
'currency': 'USD', 'currency': 'USD',
'depends': ['base','web'], 'depends': ['base', 'web'],
'data': [ 'data': [
'data/res_currency_data.xml',
'views/assets.xml', 'views/assets.xml',
], ],
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],
@ -36,4 +50,4 @@ that might conflict with this module.
'auto_install': False, 'auto_install': False,
'application': False, 'application': False,
'license': 'LGPL-3', 'license': 'LGPL-3',
} }

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- تحديث رمز الريال السعودي تلقائياً عند تثبيت الموديول -->
<!-- إلغاء حماية التحديث مؤقتاً -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'base'), ('name', '=', 'SAR')]" />
</function>
<value eval="{'noupdate': False}" />
</function>
<!-- تحديث رمز العملة السعودية بالرمز الجديد -->
<record id="base.SAR" model="res.currency">
<field name="symbol"></field>
<field name="position">before</field>
</record>
<!-- إعادة تفعيل حماية التحديث -->
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'base'), ('name', '=', 'SAR')]" />
</function>
<value eval="{'noupdate': True}" />
</function>
</odoo>

View File

@ -1,2 +1,43 @@
After installing this module, copy the symbol () and paste it in the currency symbol field SAR Symbol Font - Enhanced Version
for the Saudi Riyal (SAR) currency in: Accounting > Configuration > Accounting > Currencies. ================================
رمز الريال السعودي الجديد - نسخة محسنة
====================================
Features / المميزات:
===================
✓ Automatic Saudi Riyal symbol installation - no manual setup required
✓ التثبيت التلقائي لرمز الريال السعودي - لا يتطلب إعداد يدوي
✓ Compatible with custom themes (uses inherit fonts)
✓ متوافق مع القوالب المخصصة (يستخدم خطوط وراثية)
✓ Clean implementation without font conflicts
✓ تطبيق نظيف بدون تعارض في الخطوط
✓ Optimized for performance and minimal system impact
✓ محسن للأداء وتأثير أدنى على النظام
Installation / التثبيت:
=======================
1. Install the module / تثبيت الموديول
2. The Saudi Riyal symbol will be automatically applied / سيتم تطبيق رمز الريال تلقائياً
3. No additional configuration needed / لا حاجة لإعدادات إضافية
Technical Notes / ملاحظات تقنية:
===============================
- Uses dedicated sar-symbol font for optimal rendering
- يستخدم خط sar-symbol المخصص للعرض الأمثل
- Removed Tajawal font conflicts for better theme compatibility
- إزالة تعارضات خط تاجوال للتوافق الأفضل مع القوالب
- Supports both Arabic and English interfaces
- يدعم الواجهات العربية والإنجليزية
Version History / تاريخ الإصدارات:
=================================
v14.0.2.1.0: Enhanced compatibility, automatic setup, theme-friendly
v14.0.2.0.0: Original version with Tajawal font
Author: bst-inn, Amro00743, Expert SA

View File

@ -1,15 +1,4 @@
@font-face { /* ===== خط رمز الريال السعودي الجديد فقط ===== */
font-family: 'Tajawal-Regular';
src: url('../fonts/Tajawal-Regular.eot');
src: url('../fonts/Tajawal-Regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/Tajawal-Regular.woff2') format('woff2'),
url('../fonts/Tajawal-Regular.woff') format('woff'),
url('../fonts/Tajawal-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face { @font-face {
font-family: 'sar-symbol'; font-family: 'sar-symbol';
src: url('../fonts/sar-symbol.eot?ebwrxj'); src: url('../fonts/sar-symbol.eot?ebwrxj');
@ -22,10 +11,9 @@
font-display: block; font-display: block;
} }
/* تنسيق أيقونات الريال */
[class^="icon-sar"], [class*=" icon-sar"] { [class^="icon-sar"], [class*=" icon-sar"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'sar-symbol' !important; font-family: 'sar-symbol' !important;
/* Don't use speak property as it causes lint warnings */
-webkit-font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga';
font-feature-settings: 'liga'; font-feature-settings: 'liga';
font-style: normal; font-style: normal;
@ -33,8 +21,6 @@
font-variant: normal; font-variant: normal;
text-transform: none; text-transform: none;
line-height: 1; line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@ -43,17 +29,25 @@
content: "\e900"; content: "\e900";
} }
/* General font settings */ /* ===== دعم رمز الريال في الحقول النقدية ===== */
*:not(.fa):not(.oi) { .oe_currency_value,
font-family: 'Tajawal-Regular', 'sar-symbol', sans-serif !important; .o_account_report_column_value,
.o_account_report_summary_value,
[data-currency="SAR"],
.o_monetary_field,
.o_field_monetary,
.o_field_monetary input,
.currency_field,
span[t-field-options*="currency"] {
font-family: inherit, 'sar-symbol' !important;
} }
/* Report specific elements */ /* تقارير PDF */
.page, .header, .footer { .page, .header, .footer {
font-family: 'Tajawal-Regular', 'sar-symbol', sans-serif !important; font-family: inherit, 'sar-symbol' !important;
} }
/* Special class for SAR amount fields */ /* رمز العملة في الحقول */
.oe_currency_value::before, .oe_currency_value::before,
.o_account_report_column_value::before, .o_account_report_column_value::before,
.o_account_report_summary_value::before, .o_account_report_summary_value::before,
@ -66,9 +60,10 @@
width: 0; width: 0;
} }
/* إخفاء في بعض التقارير حسب الحاجة */
body .o_content .o_account_reports_body .oe_currency_value::before, body .o_content .o_account_reports_body .oe_currency_value::before,
body .o_content .o_account_reports_body .o_account_report_column_value::before, body .o_content .o_account_reports_body .o_account_report_column_value::before,
body .o_content .o_account_reports_body .o_account_report_summary_value::before, body .o_content .o_account_reports_body .o_account_report_summary_value::before,
body .o_content .o_account_reports_body .o_account_report_line [data-parent-id] .o_account_report_column_value::before { body .o_content .o_account_reports_body .o_account_report_line [data-parent-id] .o_account_report_column_value::before {
display: none; display: none;
} }