Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Time Zone Problem in odoo

Subscriure's

Get notified when there's activity on this post

This question has been flagged
timezoneportalwebsite
8 Respostes
55022 Vistes
Avatar
Hilar Andikkadavath

I can see so many topics regarding timezone, still, it's not clear about its manipulations on odoo. And also need clarifications for the system behavior for portal users.
NB: - Psql stores DateTime in UTC

3
Avatar
Descartar
OdooBot
Yes, you are right. We disscussed the same in the above. Datetime data in db is stored in and according to the users timezone it will get automatically converted and by this way we can handle users from different timezones. While loading the view odoo is actually adding tz context with the stored data. No need of any extra configurations to manage account and reports. 

On Fri, 30 Aug 2019, 11:02 pm Dmitry Somov, <dmitry.somov@gmail.com> wrote:

A new answer on Time Zone Problem in odoo has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

Avatar
Anil Kesariya
Best Answer

Hilar,

Yes, system (database) captures time in UTC format just because odoo allows users to login from anywhere in the world and every person belongs to different country have different timezone.

So, odoo evaluates the time based on the logged in user's timezone. If you don't know about how to set the timezone in users, you can go user's form either from preferences or from setting open the particular user from which you are trying to logged in. system (odoo) will display time according to your (user's) set timezone.

Hope this answer may help you to more clear about timezone.

Regards,

Anil.

8
Avatar
Descartar
Hilar Andikkadavath
Autor

I know This and I mentioned that in question, thats only applicable on which user is using the orm methods, what is the case of public, and if you are fetching datas through query? Next case is for portal users, some times you have to fetch data as SUPERUSER and you can display data as in format of SUPERUSER TZ

Anil Kesariya

If you want to display the datetime info on website, you need to convert the manually in localise format. you can pytz lib to customise this.

This e.g. may help you.

from datetime import datetime

import pytz

user_tz = self.env.user.tz or pytz.utc

local = pytz.timezone(user_tz)

display_date_result = datetime.strftime(pytz.utc.localize(datetime.strptime(your_date_or_datetime_info, DEFAULT_SERVER_DATETIME_FORMAT)).astimezone(local),"%d/%m/%Y %H:%M%S")

try this.

Hilar Andikkadavath
Autor

orm methods returns datetime data according to the users zone. Other cases I used momentJs. above method is also good

Anil Kesariya

@hilar, that's great if you can use momentJs.

Avatar
Ali mughal
Best Answer

In my scenario, I want to subtract two dates but when I fetch the date it gives me UTC time and date.  

#first import this library
from pytz import timezone
#convert the date string into object
now_utc_date=datetime.strptime(now_utc,"%Y-%m-%d %H:%M:%S")
print('utc date and time', now_utc_date)
# now i am changing timezone
now_dubai = now_utc_date.astimezone(timezone('Asia/Dubai'))
print('converted time',now_pacific.strftime("%Y-%m-%d %H:%M:%S")) I hope this code resolve the error
0
Avatar
Descartar
Avatar
Dmitry Somov
Best Answer

It has been discussed in the community for a while:
https://www.odoo.com/forum/help-1/question/time-zone-problem-in-odoo-118905
https://www.odoo.com/forum/help-1/question/user-timezone-not-applied-to-report-filters-9478
In my opinion there is a logic behind the default treatment of timezones in Odoo:
1) Transactions are recorded with UTC timestamp for all users (server time is UTC)
2) Transactions are displayed to users in their timezone (UTC +TZ delta)

Impacts:
1) For two users working in various timezones to have identical reports requires setting their time to UTC
2) Some transactions recorded same day (late hours) in Western timezones will be timestamped next day on server and will be shown in the reports for next day
3) Some transactions recorded same day (early hours) in Eastern timezones will be timestamped previous day on server and will be shown in the reports for previous day
4) Reports which do not take time as a parameter (only day) will be shown identical to all users. Some transactions from Western timezones day ends (local time) and Eastern timezones day starts (local time) won’t be shown.

Conclusion:
Accountants should be aware of this behavior and should setup their policies respectively:
1) For the reports taking DAY AND TIME as parameters they should login under a UTC-USER
2) For the reports taking only DAY as a parameter they may login either under a LOCAL TIMEZONE USER or under a UTC-USER

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
Error after changing some fields in 'my details' page.
portal website
Avatar
Avatar
1
de gen. 23
2852
website.menu access rights for dedicated groups
portal website odoo17
Avatar
0
de febr. 25
2204
Make an extranet in Odoo, with content, shop, portal... all only visible to customers who are logged in
portal website v17
Avatar
0
de set. 24
2027
Portal saves multiple inputs from dynamically generated list
portal input website
Avatar
0
de des. 23
2130
website account details on portal_my_details
portal required website
Avatar
Avatar
2
d’ag. 22
4129
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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