İç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

Where exactly is the date format filled from for a language?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
dateodoo8.0v14
1 Cevapla
9701 Görünümler
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys

I've been looking at languages and the date formats / time formats.
If I look in the code I can see the language being fetched from the settings of your Ubuntu machine from the file misc.py under /openerp/tools/misc.py
I've modified the locales file for en_US under /usr/share/i18n/locales/en_US and the same for nl_NL like this:

en_US:
% Appropriate date representation (%x)
%       "%d/%m/%Y"
d_fmt   "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0059>"

nl_NL:
d_fmt   "<U0025><U0064><U002D><U0025><U006D><U002D><U0025><U0079>"

Yet my date format when creating a new Odoo db is still wrong. I will get %m/%d/%Y for en_US and %d-%m-%Y for nl_NL..


Can anybody tell me where exactly I should set the date format for a specific format? I've been trying some things for hours but nothing succeeds.
NOTE: I'm not talking about modifying the date format manually under settings > Languages but I'm talking about setting the dateformat without accessing the languages menu, so by code.

With kind regards
Yenthe

 

0
Avatar
Vazgeç
Avatar
Bole
En İyi Yanıt

Settings -> Languages

number, date, time and simmilar formats are defined there.. 
hope it helps : )
 

to do it by code... define some base module and put yml file in (and in __openerp__.py just like any test yml)
( modify yml to your needs) :

-
  I force the installation of Croatian language
-
  !python {model: base.language.install}: |
    lang_ids = self.pool.get('res.lang').search(cr, uid, [('code', '=', 'hr_HR')], limit=1, context=context)
    if not lang_ids:
      wizard_id = self.create(cr, uid, {'lang': 'hr_HR'}, context)
      self.lang_install(cr, uid, [wizard_id], context)
-
  I make Croatian as default language if installed
-
  !python {model: res.lang}: |
    if self.search(cr, uid, [('code', '=', 'hr_HR')], limit=1):
      value_obj = self.pool.get('ir.values')
      ids = value_obj.search(cr, uid, [
        ('name', '=', 'lang'),
        ('key', '=', 'default'),
        ('model', '=', 'res.partner'),
      ], limit=1, context=context)
      vals = {
        'name': 'lang',
        'key': 'default',
        'key2': False,
        'model': 'res.partner',
        'object': False,
        'value_unpickle': 'hr_HR',
      }
      if ids:
        value_obj.write(cr, uid, ids, vals, context)
      else:
        value_obj.create(cr, uid, vals, context)
-
  I correct all formats for Croatian language
-
  !python {model: res.lang}: |
    lang_ids = self.search(cr, uid, [('code', '=', 'hr_HR')], limit=1)
    if lang_ids:
      self.write(cr, uid, lang_ids, {
        'grouping': '[3,0]',
        'decimal_point': ',',
        'thousands_sep': '.',
        'name': 'Croatian / Hrvatski',
        'date_format': '%d.%m.%Y',
        'time_format': '%H:%M:%S',
      }, context)

 

 hope this helps ;)

1
Avatar
Vazgeç
Yenthe Van Ginneken (Mainframe Monkey)
Üretici

Hi Bole that is exactly what I want to surpass. I want this date format to be filled in correctly automaticly. Every language installed should by default have the date format d%/m%/Y%, or atleast for the Dutch / Nederlands language.

Yenthe Van Ginneken (Mainframe Monkey)
Üretici

I've added a note for this in my post as this might have not been clear enough, sorry about that.

Bole

here , adited my previous answer according to your needs ;) hope this helps

Yenthe Van Ginneken (Mainframe Monkey)
Üretici

@Bole alright this looks very interesting! What is the best (already existing) module to place this extra file in? And I can only add in the last part from !python {model: res.lang}: | right?

Bole

you can put it in any module that you install on database... i ususaly put it in custom account_template module (because i rarely use standard localization modules l10n_xx) or any other module... and yes, you can modifiy yml file to your needs, the firt part is just to make 100% sure i have desired lang installed before i make any modifications

Yenthe Van Ginneken (Mainframe Monkey)
Üretici

Okay I get the concept but not 100% how to do it. So I can create a new module with scaffold and then simply add one file (languages.yml for example) in the folder, add it to the __openerp__.py file and done? How would this ever be triggered on installation of a language for example then? :s

Bole

yml files are usefull, just grep/search for yml files in standard addons and look for examples... it can execute tests, but also it can execute python code during instalation of module... it is not trigered on instalation of languge... that comes later... but what you can do is use standard english lang for basic instalation, and then trigger instalation of desired languages troug module ( copy paste entire code) and do it for avery language you want installed and set acording to your needs : ) ....

Bole

additional note: I use this on v7, haven't test it on v8, also.. can't actualy debug yml file.... it is only interpreter for some actions... so you need to get the concept and try until it works as wanted ;)

Bole

note2: to find out other yml options check: openerp.tools.yaml_tag.py & openerp.tools.yaml_import.py

Yenthe Van Ginneken (Mainframe Monkey)
Üretici

I've added your dateformat block under the module l10n_be in the already existing file account_chart_template.yml but I get errors.. raise YamlImportException("Can not process YAML block: %s" % node) Any ideas Bole? Would you want to share this custom module of you by the way? This concept is very interesting!

Bole

yml idea fo4r languages is copied from here: https://github.com/apollet/smile_openerp_addons_7.0/tree/master/smile_base chek that module...

Yenthe Van Ginneken (Mainframe Monkey)
Üretici

Awesome! This is simply amazing. Strange that it isn't documented anywhere. Thanks Bole, accepted & upvoted.

Bole

(beer) :)

Bole

Huh... just found another interesting usage for yml files.... in v8.. check stock module... stock_data.yml ....

OdooBot
Hmmm interesting! Those yml have quite some options so it seems and nobody uses them.
By the way, your idea of just writing on the id and setting to true is working perfect. (from Linkedin)

Thanks
Yenthe

2015-01-07 17:22 GMT+01:00 Bole <bole-dajmi5-com@mail.odoo.com>:

Huh... just found another interesting usage for yml files.... in v8.. check stock module... stock_data.yml ....

--
Bole
Sent by Odoo S.A. using Odoo about Forum Post False

Bole

well.. in v7 i noticed yml files beeing used mostly for tests.. in v8 the more i look the more usage i notice... it is indeed very usefull tool, because you can execute some py methods during instalation of modules, meaning you can decide what to install , what data to import based on current database setup... i see this as wery fleksible tool..

OdooBot
Hey Bole

Yeah indeed it is a very flexible and handy way to add/modify some stuff.
I'm already using it to install languages, change formats, change automated actions etc..

Thank you for pointing this out to me, this is a gem to automate stuff.

With kind regards
Yenthe

2015-01-08 9:50 GMT+01:00 Bole <bole-dajmi5-com@mail.odoo.com>:

well.. in v7 i noticed yml files beeing used mostly for tests.. in v8 the more i look the more usage i notice... it is indeed very usefull tool, because you can execute some py methods during instalation of modules, meaning you can decide what to install , what data to import based on current database setup... i see this as wery fleksible tool..

--
Bole
Sent by Odoo S.A. using Odoo about Forum Post False

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
customize date filter odoo 14
filter date v14
Avatar
Avatar
1
Tem 22
4113
How to change first day of the week Çözüldü
date listview v14
Avatar
1
Ara 20
8405
Filter as a date
filter date filtering v14
Avatar
Avatar
1
Tem 23
3771
odoo server not starting after amazon rds postgres upgrade Çözüldü
rds odoo8.0 odooV8_database v14
Avatar
Avatar
Avatar
3
Ağu 21
4989
Invoice date same as sales order date
invoice date odoo.sh v14
Avatar
Avatar
1
Tem 21
3560
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