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

User timezone not used

Subscriure's

Get notified when there's activity on this post

This question has been flagged
timezonedatetimev14
3 Respostes
6858 Vistes
Avatar
Alberto

To recreate I have a single Datetime field and a simple form view for it.


I've changed all of my Odoo users timezone to Japan (UTC+9) for test (settings/users/manage users), even the users marked as inactive. However when a user logs in and goes to that form and edits datetime field the field takes system OS timezone (UTC+2) in question and ignores user timezone in settings.

I've tested this - if user enters for example 2021-06-13 13:12:46 it is saved in database as 2021-06-13 11:12:46 which is correct for timezone UTC+2 , however since user has Japan set as their timezone in the settings I expected that to be saved as 2021-06-13 04:12:46 in the database.


Is this expected behaviour? Is it ALWAYS going to be like this (is there any case where it will take user timezone into the account?). For what is the user timezone even used?


Also can I somehow take this information from the env? Same as I get user timezone:

self.env.user.tz

but for system timezone? Or do I have to get it myself with Python? Edit: Actually I can't do it with Python for users, I can only get server system timezone not the user system timezone. How do I deal with this?


I''m  using Odoo 14 and Ubuntu 20


Edit: I can't comment on your answers because I lack 8 karma, whoever thought of this is...

anyway for my question I think I have to rely on users setting their timezone in settings to match their system timezone? Aka I hope they don't screw around(since they can easily select wrong one)?

0
Avatar
Descartar
Avatar
Ravi Gadhia
Best Answer

yes, it's the standard behavior of odoo.
Odoo takes browser timezone (eventually system timezone) regardless of the timezone of the user currently lognin.

for testing purpose, if you want to change the timezone of the browser timezone there are versions browser plugin available in the market but my favorite is open chrome with specific timezone with command line 

TZ='UTC' open -na "Google Chrome" --args "--user-data-dir=$HOME/chrome-profile"

Note: Timezone set on the user is used in a various module like event, employee_leave, resource, calendar_appointment to determine user availability 

1
Avatar
Descartar
joaquin.aparicio@rulesware.com

I have the same problem. How I can get the browser timezone in odoo environment?? So, if I am able to get the browser timezone, I'll can detect the mismatch between odoo user timezone and browser timezone and maybe set the same or consider the differences between them before save in UTC. I see the odoo detect this mismatch when set the user timezone preference and shows a warning message but it is a widget and I was not able to know how to do it. Any advice???

Avatar
Divyansh Tripathi
Best Answer

Instead of you changing it for every user, the user themselves can set it and it should work. Just log in as a user and press the logged-in username on the top right corner, select preferences, and there set the time-zone and then see if it gets you desired results.

0
Avatar
Descartar
Avatar
Alberto
Autor Best Answer

@Divyansh Tripathi (can't comment because of stupid forum karma system so I have to answer instead) I told you that it doesn't work, no matter if users change it themselves or if I change it for them.

This is development server and it always takes my system timezone which is UTC+2 instead of logged in user timezone defined in settings (no matter which user I log in as).

Edit: Are you saying I have to expect from users to set their timezone in setting to match their system timezone correctly? In that case it would work but I would have to enforce it (tell them) and hope they don't mess around and select wrong timezone.

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
Timezone problem to convert datetime to string
timezone datetime v14
Avatar
0
d’oct. 21
4611
Take Users Timezone Solved
timezone datetime
Avatar
Avatar
Avatar
Avatar
3
de jul. 25
5271
Changing the time/date setting in V14 system Solved
datetime v14
Avatar
Avatar
1
de febr. 21
11027
Time & Date Issue Solved
timezone datetime
Avatar
Avatar
Avatar
6
de set. 19
12501
How to add time difference on datetime object in Email Template ?
timezone datetime
Avatar
Avatar
Avatar
2
de març 16
8673
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