This module was written to extend the functionality of Odoo language engine to support formatting Date, Time and Datetime fields easily and allow you to print them in the best format for the user.
auto_awesome What this module does
AI-generated from the code · Odoo 16.0Adds helper functions so dates, times and datetimes can be printed in each user's preferred language format. It is a technical tool used by other modules, not a screen users open directly.
This module extends Odoo's language settings (res.lang) with two helper methods that other modules can call when they need to show a date, a time or a full date-and-time in the format the user's language expects.
best_matchfinds the most suitable installed language: it can take a language code such asen_US, otherwise it falls back to the current context language, the user's language, or the first active language in the database. If the requested language is not installed, it either raises an error or safely returns the first installed language, depending on the option chosen.datetime_formatterconverts a value into text using that language's date and time format. It accepts a text, a number or a real date-time value. The caller can ask for a date only, a time only, or both joined by a separator. If the language has no format configured, standard server formats are used as a fallback.
There are no new menus, buttons, reports or business rules for end users. The module only touches res.lang and depends on base. Its purpose is to make date and time display consistent and localised wherever other modules choose to use it.
Depends on
Models and fields (1)
- res.lang · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 5 confirmed, 4 with no information of 9 versions.
Sources · Odoo 14.0
Confirmed on 2026-11-03 in branch 14.0 of OCA/server-tools.
terminal Installation and usage
OCA documentation · Odoo 16.0Usage
Source · Odoo 16.0This module adds a technical programming feature, and it should be used by addon developers, not by end users. This means that you must not expect to see any changes if you are a user and install this, but if you find you have it already installed, it's probably because you have another modules that depend on this one.
If you are a developer, to use this module, you need to:
- Call anywhere in your code:
formatted_string = self.env["res.lang"].datetime_formatter(datetime_value)- If you use Qweb:
<t t-esc="env['res.lang'].datetime_formatter(datetime_value)"/>- If you call it from a record that has a
langfield:
formatted_string = record.lang.datetime_formatter(record.datetime_field)models.ResLang.datetime_formatterdocstring explains its usage.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.