Odoo documentation sources
Go to file
Julien Mougenot 35aae86dbd [IMP] web: Owl DateTimePicker
This commit introduces a date picker OWL component meant to handle the
following use-cases:
- date picker
- date & time picker
- date range picker
- date & time range picker

Basically, this component is the union of the two previous third-party
libraries handling these cases: TempusDominus and DateRangePicker.

New components introduced:

* The main addition of this commit is the `DateTimePicker` itself which
handles the display and interactions of the calendar and time pickers.
> see @web/core/datetime/datetime_picker

* The picker can then be coupled to an input using the
`useDateTimePicker` hook. The purpose of this hook is to handle events
on a given input element and syncronize its value to a date picker it
will spawn in a popover.
> see @web/core/datetime/datetime_hook

* Lastly, a simple `DateTimeInput` component will render an input and
call the hook mentioned above to handle it. This component is
effectively replacing the previous DatePicker and DateTimePicker
components (note that it does not handle range values).
> see @web/core/datetime/datetime_input

Another noticeable change of this commit is the definition of daterange
fields in views:

- Previously, the arch would have to define both fields
and bind them via their options, while also adding an arrow between
inputs or other forms of connection.

- In the new implementation, only the start date field must be declared,
and a date range can be spawned by providing an `end_date_field` in its
options.

Example:
```xml
<field
    name="start_datetime"
    widget="daterange"
    options="{'end_date_field': 'end_datetime'}"
/>
```

warning Added limitations:

- this new way of declaring date ranges means that templates have been
revised to declare one field tag instead of two. This means that list
views using date ranges have lost the ability to be sorted on their end
date fields.

> Justification: the current use cases have been reviewed and it has
been decided that it was not needed to sort on the end date on the
affected list views.

> Workaround: drop the date range and declare both fields as simple date
pickers (i.e. without the end_date_field option).

- all modifiers applied to a field using a date range will be copied and
applied to the end date field. There is no way to define modifiers
specific to one field or the other.

> Justification: there was no use case where one of the two fields
needed specific modifiers.

> Workaround: same as the previous point: split the range into 2 simple
date picker fields.

Additional notes:

- the widget="daterange" is not mandatory in form views, but is required
in list views because only fields with explicit widgets will not be
rendered as simple <span> elements. The date range feature will be
available as soon as an end_date_field is specified.

- as the end date field is not explicitly defined in the view anymore,
any modifier depending on it need to have it defined as invisible
somewhere in the arch.

Task ID: 3121497

closes odoo/documentation#5013

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-07-04 12:47:02 +02:00
.tx [I18N] theme: remove reference to translation 2023-03-09 12:00:58 +01:00
content [IMP] web: Owl DateTimePicker 2023-07-04 12:47:02 +02:00
extensions [IMP] odoo_theme: fix menu links 2023-04-14 19:45:57 +02:00
locale [I18N] *: export 16.0 source terms 2023-06-20 22:03:07 +02:00
redirects [ADD] website: reCAPTCHA 2023-06-27 22:40:15 +02:00
static [IMP] odoo_theme: design improvements 2023-04-12 12:26:14 +02:00
tests [ADD] tests: image size checker 2023-04-11 15:17:26 +02:00
.gitattributes [ADD] .gitattributes: include RST files in language statistic on GitHub 2022-04-29 11:01:52 +02:00
.gitignore [ADD] .gitattributes: include RST files in language statistic on GitHub 2022-04-29 11:01:52 +02:00
commit_template.txt [FIX] *: enforce 1 newline on files end 2022-11-18 18:04:49 +01:00
conf.py [FIX] werkzeug version 2023-06-09 01:07:49 +02:00
Makefile [REF] tests: split checkers 2023-03-10 11:24:06 +01:00
README.md [IMP] README: remove version from links and rephrase explanations 2023-01-03 20:14:55 +01:00
requirements.txt [FIX] requirements: bump libsass to match odoo 2023-05-16 08:24:19 +02:00

Odoo documentation

Build the documentation locally

Requirements

  • Git
  • Python 3.6, 3.7, or 3.8
  • Python dependencies listed in the file requirements.txt.
  • Make
  • A local copy of the odoo/odoo repository (optional)

Instructions

  1. In a terminal, navigate to the root directory of the documentation and build it make. Additional commands are available with make help.
  2. Open the file documentation/_build/html/index.html in your web browser.
  3. See this guide for more detailed instructions.

Optional: place your local copy of the odoo/odoo repository in the parent directory or in the root directory of the documentation to build the latter with the documented Python docstrings.

Contribute to the documentation

For contributions to the content of the documentation, please refer to the Introduction Guide.

To report a content issue, request new content or ask a question, use the repository's issue tracker.

Learn More

To learn more about Odoo, in addition to the documentation, have a look at the official eLearning and Scale-up, The Business Game.