Repository
OCA/server-tools · module folder · Try on Runboat
Module version
1.0.0
Category
Tools
Folder size
0.05 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/server-tools
Last tracking update
2026-08-07 08:09:23
Authors
Odoo Community Association (OCA), Tecnativa, Grupo ESOC Ingeniería de Servicios
Maintainers
Odoo Community Association (OCA), Tecnativa, Grupo ESOC Ingeniería de Servicios
Committers
Weblate, oca-ci, Carolina Fernandez
Odoo dependencies
odoo/odoo:
Python dependencies
None
System dependencies
None
Required by
None
Description

Code Analysis

Views touched (0)

No views found for this module.

HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
checks failing
Open since
158 days ago
Last activity
157 days ago
Repository
OCA/server-tools
Pull request
[MIG] datetime_formatter: Migration to 18.0 (#3554)