odex25_standard/odex25_takaful/odex_takaful/__init__.py

25 lines
769 B
Python

from . import models
from . import controllers
from . import reports
from . import wizards
def _update_payment_method_names(cr, registry):
"""Update payment method names to Arabic after module installation/upgrade."""
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
translations = {
'cash': 'نقدي',
'bank': 'تحويل بنكي',
'direct_debit': 'استقطاع',
'check': 'شيك',
'network': 'شبكة',
}
PaymentMethod = env['takaful.payment.method']
for method_key, arabic_name in translations.items():
records = PaymentMethod.search([('payment_method', '=', method_key)])
if records:
records.write({'name': arabic_name})