İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to set default language in res_partner.py

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
res.partnerres.user
2 Cevaplar
15480 Görünümler
Avatar
Pravitha

I have defined a new language named English-India and its code is en_GB and I want to get this language as default set on language field when a customer and user is created.I overridden res_users.py and res_partner.py and I gave the following code to _defaults of res_users and `res_partner.

_defaults = {
    'lang':'en_GB',
    }

In user creation the language field is English-India by default but its not working in customer creation. Can some one help?

4
Avatar
Vazgeç
Avatar
Omal Bastin
En İyi Yanıt

Hi, Goto Settings > Technical > Actions > User defined Defaults, there you can find that default value is set as en_US, you can delete this record or change it to your language

9
Avatar
Vazgeç
Pravitha
Üretici

This was what i wanted

Avatar
ClueLogics Technologies Pvt. Ltd.
En İyi Yanıt

Hey Pravitha

DO it as below :

inherit your res.partner

and add this new function in that class (res_partner)

   def _get_mylang(self, cr, uid, context=None):
         ids = self.pool.get('res.lang').search(cr, uid, [], context=context)
         res = self.pool.get('res.lang').read(cr, uid, ids, ['code', 'name'], context)     
         return [(j['code'], j['name']) for j in res] + [('','')]

and then just add this method in _defauts link below

   _defaults = {
       'lang':_get_mylang,
}

or also you can go through -- > Settings > Technical > Actions > User defined Defaults thats it

Thanks
Sandeep

8
Avatar
Vazgeç
Pravitha
Üretici

Helo sir, Thankyou for the reply . can i ask you somthing will it show english also in the selection?

Omal Bastin

Hi, your function will only return the id of the language. then lang field is actually a selection. So the function should be like def _lang_get(self, cr, uid, context=None): lang_pool = self.pool.get('res.lang') ids = lang_pool.search(cr, uid, [('code','=','en_GB')], context=context) res = lang_pool.read(cr, uid, ids, ['code'], context) return r['code']

ClueLogics Technologies Pvt. Ltd.

is this a selection field ??

ClueLogics Technologies Pvt. Ltd.

this will work for money2one relation

Pravitha
Üretici

yes it is a selection field

ClueLogics Technologies Pvt. Ltd.

see updated answer now

ClueLogics Technologies Pvt. Ltd.

all the available language will be seen into that selection field

Omal Bastin

its actually wrong!! please check it

ClueLogics Technologies Pvt. Ltd.

whats wrong?? , let me know

ClueLogics Technologies Pvt. Ltd.

man, it should not be wrong .......:))

Omal Bastin

your _get_mylang will return a list of tuples. To get a default value, you need to pass the key value of the selection list. jou just check it in your local server

ClueLogics Technologies Pvt. Ltd.

oh man it is fine .:):) and for your information ,, selection gets tuple value with (key,value)

Omal Bastin

:-) nothing more to say

Pravitha
Üretici

thankyou for the help sir

ClueLogics Technologies Pvt. Ltd.

ok that's fine

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
res.users & res.partner
res.partner res.user
Avatar
Avatar
Avatar
2
Şub 23
8132
What is the relationship between res.partner and res.user? If I override res.partner, to create 'students', will users be automatically created? Çözüldü
user res.partner res.user
Avatar
Avatar
1
Ara 23
22096
Adding A column to res.partner
relationship res.partner res.user
Avatar
Avatar
1
Ağu 19
7003
add partner table field on user registration page
res.partner res.user registration v14E
Avatar
Avatar
1
Nis 25
2075
Domain for res.partner having which are tagged with users ? Çözüldü
res.partner
Avatar
Avatar
2
Eki 23
6546
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now