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

Why is the date displayed like this? QWEB

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
dateinheritanceqwebtemplatesodoov11
5 Cevaplar
6578 Görünümler
Avatar
Benjamin Cherpas

Hi,


I want to display the activity date deadline but it takes a wrong format. I work on French odoo but the date is displayed in English, with the following format and time set to 00:00:00 but this is a date field not datetime...

Format : Wed Dec 18 2019 00:00:00 GMT+2

This is weird because even in my database, the date is displayed like 18/09/2019, so why is it displayed like that when I call the field in inherited qweb template?


Here is my qweb inheritance: 

<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-extend="mail.KanbanActivityDropdown">
<t t-jquery=".fa-clock-o" t-operation="after">
<t t-if="log.date_deadline > new Date() and log.activity_type_id[1] != 3">
<span><t t-esc="log.date_deadline" /></span>
</t>
</t>
</t>
</templates>


Hope that anyone can help me. Thanks !


UPDATE: 

I already tried t-field, t-options, t-field-options with format or widget: no effect...


Bye.

2
Avatar
Vazgeç
faOtools

Try using the widget 'date', e.g.:

<span t-field="log.date_deadline" t-options='{"widget": "date"}'/>
Avatar
faOtools
En İyi Yanıt

Okay, it seems that is because of default: date is kept with time zone in the database (not UTC).

I guess the simplest way to replace timezone is to re-calculate date in Python (or alternative apply fields_utils in Javascript). Something like (not tested):

@api.multi
@api.depends("date_deadline")
def _compute_no_tz_date(self):
for record in self:
record.no_tz_date = fields.Date.to_string(record.date_deadline.date())
# perhaps also better to apply time zone transformation
# have a look at the method _compute_state_from_date in the same file
no_tz_date = fields.Date(compute=_compute_no_tz_date)

Then, this no_tz_date should be shown in XML just as a string without time or time zone



1
Avatar
Vazgeç
Avatar
Benjamin Cherpas
Üretici En İyi Yanıt

It has no effect (see updated answer) I don't understand why...


UPDATE:

date_deadline field in MailActivity object (in mail_activity.py file):

date_deadline = fields.Date('Due Date', index=True, required=True, default=fields.Date.context_today)


Log declaration (I don't know if it is declared in some JS file or not):

<li t-if="!_.isEmpty(records)">
<ul class="nav o_activity_log">
<t t-foreach="_.keys(records)" t-as="key">
<t t-set="logs" t-value="records[key]" />
<li class="o_activity_label">
<strong t-attf-class="o_activity_color_#{key}">
<t t-esc="selection[key]" /> (<t t-esc="logs.length"/>)
</strong>
</li>
<li t-foreach="logs" t-as="log" t-att-data-activity-id="log.id" class="o_schedule_activity">
<div class="o_activity_title pull-left">
<span t-attf-class="fa #{log.icon} fa-fw" />
<strong>
<t t-esc="log.title_action or log.activity_type_id[1]" />
</strong>
<div>
<span class="fa fa-clock-o fa-fw" />
<span t-att-title="log.date_deadline"><t t-esc="log.label_delay" /></span>
<t t-if="log.user_id[0] != uid">
<span class="ml4 fa fa-user" />
<span><t t-esc="log.user_id[1]" /></span>
</t>
</div>
</div>
<div class="pull-right">
<span class="o_mark_as_done o_activity_link o_activity_link_kanban fa fa-check-circle fa-2x mt4" t-att-data-activity-id="log.id" title="Mark as done" />
</div>
</li>
</t>
</ul>
</li>

Thank you for help !

0
Avatar
Vazgeç
faOtools

Share then the field date_deadline Python declaration or Javascript code (depending on what is log - Odoo class or Javascript object).

Benjamin Cherpas
Üretici

Done. Thanks !

Benjamin Cherpas
Üretici

Thank you so much it works ! But I used from_string instead of to_string (sorry I can't reply your comment above, just mine). You have been helpful so I'm disappointed to not have enough karma to upvote your answer. Thaaaanks again !!!

faOtools

You are welcome. As for karma: I upvoted your question - the situation is quite interesing. Besides, if you need karma in the Future, you can pass a few learning courses - https://www.odoo.com/slides/all

Benjamin Cherpas
Üretici

Oh nice! I'll think about that! Thanks a lot!

Regards.

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
Template inheritance not working in Odoo 15
inheritance qweb templates v15
Avatar
Avatar
1
Mar 22
7824
How to inherit purchase order body view?
v8 inheritance qweb templates
Avatar
Avatar
2
Mar 15
8310
how to change tooltip question mark symbol? Çözüldü
web inheritance qweb templates frontend
Avatar
1
Ara 23
2391
How to remove template changes made by other addons?
inheritance qweb templates overwriting overriding
Avatar
Avatar
1
Eyl 22
6341
Odoo 11: custom report generate empty pdf (html works fine) Çözüldü
pdf qweb templates v11.0 odoov11
Avatar
Avatar
Avatar
Avatar
Avatar
11
Şub 19
23547
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