Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

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

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

How do datetime fields work in Odoo?

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
technicalquickstartTechnicalQuickstart
1 Ответить
317 Представления
Аватар
Abraham Ismael Torales Salazar (aits)

I want to know how Odoo manages the different timezones and date format for the Backend and PDFs


Version: 19


Related forum post: Format Dates in PDF based on Customer Timezone and Language

0
Аватар
Отменить
Аватар
Abraham Ismael Torales Salazar (aits)
Автор Лучший ответ

Backend

Datetime fields shown in the backend consider the timezone set in your device (ex. the computer you are working on). 

Timezone in Computer
Backend field
Mexico City, Mexico
Tokyo, Japan

The date and time format is taken from the user language:
Language
Setting
Spanish (Latin America) / Español (América Latina)
English (US)

💡
Odoo saves the datetime field value in UTC time, but when you see it in Odoo, the time is "converted" based on your device timezone and with the user language format.


When using filters, you should put your specific time, and Odoo will look for the field raw value (in UTC).



You can also do some other configurations using Studio, like showing the month in numbers or name, or choosing whether or not to show hours or seconds.


PDF

When we add a datetime field to a PDF Report using the "/" command, the time shown considers the user timezone when downloading the PDF.

The date and time format is taken from the user language

💡
This means that you may have a timezone set in your computer, and another in your user, and you may see different times between the backend and the PDF. For the PDF, the computer timezone doesn't matter, only for the backend.

This also gives us the possibility of changing the user's timezone and/or language to match the one from the person we want to send this PDF to.



Examples:

User Language
User Time zone
Result in the PDF Report
Spanish (Latin America) / Español (América Latina)
Mexico City, Mexico
Spanish (Latin America) / Español (América Latina)
Tokyo, Japan
English (US)
Tokyo, Japan
English (US)
Mexico City, Mexico

PDF (Advanced)

If you edit the source code of the PDF Report, you will see that the field was added with a t-field.

In case we use t-out/t-esc instead of t-field, the PDF will show the time in UTC, ignoring any language format we talked about earlier.
 
If you want to format the datetime, you could do it as follows:
For showing only date using t-field or t-out:
<span t-field="doc.x_studio_datetime" t-options="{'widget': 'date'}"/>
For custom date and time format using t-out or t-esc:
<span t-out="doc.x_studio_datetime.strftime('%d/%b/%Y %I:%M %p')"/>

Date components

Time components

Code Meaning
%Y Year (4 digits)
%y Year (2 digits)
%m Month (zero-padded)
%B Month name
%b Abbreviated month name
%d Day of month (zero-padded)
%e Day of month (space-padded) (Unix only)
%j Day of year
Code Meaning
%H Hour (24-hour)
%I Hour (12-hour)
%p AM / PM
%M Minute
%S Second
%f Microseconds

Week / Weekday

Quick preset

Code Meaning
%A Weekday name
%a Abbreviated weekday
%w Weekday number (0=Sunday)
%u Weekday number (1=Monday)
%U Week number (Sunday first)
%W Week number (Monday first)
Code Meaning
%x Locale date
%X Locale time
%c Locale date & time


💡
For standard reports, user timezone still applies, but language format may be linked to partner_id in the QWeb Code in t-lang attribute.

<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>

⚠️
Be careful when editing the PDF code. Incorrect modifications may cause errors when generating or downloading the PDF. For best practices and detailed guidance, please refer to your Odoo Advisor.


Artificial Intelligence

For AI fields, if you add a prompt specifying a certain hour/time, it will be set in UTC. But when you see it in the backend, it will be shown in your device timezone. Example:

Prompt
Result in Odoo Backend for Mexico City timezone

You could also take other datetime fields for the AI prompt
Prompt
Result in Odoo Backend


Extra: contacts timezone

By default, contacts are generated with the timezone of the user that creates it. 
You can see the timezone for each contact by showing the field using Studio.
Moreover, you can also add the field that shows the difference between UTC and the selected timezone for that contact.

1
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
Format Dates in PDF based on Customer Timezone and Language Решено
technical quickstart Technical Quickstart
Аватар
1
нояб. 25
303
Explaination of Odoo domain filter with simple example Решено
technical quickstart
Аватар
Аватар
2
окт. 25
33761
How do I connect the Epson TM-T88VII to Odoo?
quickstart Quickstart
Аватар
Аватар
2
окт. 25
994
How to Set Customer-Specific Product Names Решено
quickstart Quickstart
Аватар
1
нояб. 25
1526
✅ Odoo E-commerce: How to discriminate deliveries based on the type of clients
quickstart Quickstart
Аватар
0
авг. 25
1510
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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 – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

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