Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions datetime_formatter/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
=====================
Date & Time Formatter
=====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/12.0/datetime_formatter
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-datetime_formatter
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Usage
=====

This 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 `lang` field::

formatted_string = record.lang.datetime_formatter(record.datetime_field)

* ``models.ResLang.datetime_formatter`` docstring explains its usage.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20datetime_formatter%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Grupo ESOC Ingeniería de Servicios
* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Jairo Llopis
* Vicent Cubells
* Ernesto Tejeda

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/12.0/datetime_formatter>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions datetime_formatter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
# Make these easily available for submodules
from .models.res_lang import MODE_DATE, MODE_DATETIME, MODE_TIME
20 changes: 20 additions & 0 deletions datetime_formatter/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2015, 2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa, S.L. - Vicent Cubells
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Date & Time Formatter",
"summary": "Helper functions to give correct format to date[time] fields",
"version": "12.0.1.0.0",
"category": "Tools",
"website": "https://github.com/OCA/server-tools",
"author": "Grupo ESOC Ingeniería de Servicios, "
"Tecnativa, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": [
"base",
],
}
31 changes: 31 additions & 0 deletions datetime_formatter/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# new stargate <newstargate@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-26 01:46+0000\n"
"PO-Revision-Date: 2016-11-26 01:46+0000\n"
"Last-Translator: new stargate <newstargate@gmail.com>, 2016\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr ""

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "اللغات"
30 changes: 30 additions & 0 deletions datetime_formatter/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-30 12:21+0000\n"
"PO-Revision-Date: 2017-06-30 12:21+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr "No s'ha trobat la millor associació d'idioma (%s). "

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Idiomes "
26 changes: 26 additions & 0 deletions datetime_formatter/i18n/datetime_formatter.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr ""

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr ""

30 changes: 30 additions & 0 deletions datetime_formatter/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-30 12:21+0000\n"
"PO-Revision-Date: 2017-06-30 12:21+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr "Sprache (%s) mit bester Übereinstimmung nicht gefunden"

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Sprachen"
30 changes: 30 additions & 0 deletions datetime_formatter/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-30 12:21+0000\n"
"PO-Revision-Date: 2017-06-30 12:21+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr "No se ha encontrado ningún idioma (%s) que mejor case."

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Idiomas"
31 changes: 31 additions & 0 deletions datetime_formatter/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-21 06:45+0000\n"
"PO-Revision-Date: 2016-08-21 07:41+0000\n"
"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/"
"language/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr ""

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Langues"
31 changes: 31 additions & 0 deletions datetime_formatter/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# Goran Kliska <gkliska@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-30 12:21+0000\n"
"PO-Revision-Date: 2017-06-30 12:21+0000\n"
"Last-Translator: Goran Kliska <gkliska@gmail.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr ""

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Jezici"
31 changes: 31 additions & 0 deletions datetime_formatter/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * datetime_formatter
#
# Translators:
# Paolo Valier, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-17 15:37+0000\n"
"PO-Revision-Date: 2016-03-13 09:34+0000\n"
"Last-Translator: Paolo Valier\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/"
"language/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: datetime_formatter
#: code:addons/datetime_formatter/models/res_lang.py:59
#, python-format
msgid "Best matched language (%s) not found."
msgstr ""

#. module: datetime_formatter
#: model:ir.model,name:datetime_formatter.model_res_lang
msgid "Languages"
msgstr "Lingue"
Loading