Commit Graph

86 Commits

Author SHA1 Message Date
laro-odoo
3badb434e1 [IMP] web: make date widget work with datetime field
Task-3698841

closes odoo/documentation#10325

Related: odoo/odoo#161705
Related: odoo/enterprise#67258
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2024-07-31 21:06:03 +00:00
Samuel Degueldre
489fe7d3ea [IMP] developer: add an article to explain error handling in JS
closes odoo/documentation#9240

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-05-13 14:27:54 +00:00
Samuel Degueldre
2354f0946e [FIX] developer: rewrite a bunch of outdated info in JS reference
Previously, a lot of information on the JavaScript reference page was
outdated.

This commit rewrites a bunch of sections to bring them up to date and
removes others that are no longer relevant. While a more profound rework
of the JS documentation is still needed, this commit at least reduces
the amount of outdated information significantly in the meantime.

closes odoo/documentation#9180

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-05-06 14:59:41 +00:00
Mohamed Alkobrosli
dfb88db7b6 [FW][FIX] dev/assets: typo
the "py" letter should be "by" to make the syntax correct and understood.

closes odoo/documentation#8296

Forward-port-of: odoo/documentation#8276
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-22 01:30:24 +00:00
Antoine Vandevenne (anv)
439c4521ad [IMP] reference/user_interface: reformat and clarify views reference
In particular, the following changes are made:
- Use the `class` and `attribute` admonitions along with custom
  attributes to define classes, views' root attributes, views'
  components, and attribute values. This allows re-using the responsive
  design that was made for reference lists, and getting rid of the
  previous implementation that relied on class attributes, which were not
  intended for this usage and reduce readability while hindering further
  contributions due to a lack of flexibility (no admonitions,
  sub-attributes...)
- Use definition lists to define view types to allow for clearer and
  longer descriptions.
- Rewrite and restructure the explanations when there is a lack clarity.
- Extract duplicated content to included RST files.
- Display SVG images into dedicated admonitions.
- Fix RST and English mistakes.
- Rename `view_architecture` to `view_architectures`, as it lists all
  existing architectures and doesn't describe "the architecture of a
  view".
- Replace underscores with hyphens in image file names to improve SEO.

task-3458320

closes odoo/documentation#5237

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-01-19 15:21:43 +00:00
Géry Debongnie
3d4a275196 [IMP] Rework the JavaScript tutorials
This commit rework the entire JavaScript tutorial series with the
following improvements:

-   Each chapter is now designed to be independent, allowing learners to
    follow any chapter without the necessity of completing previous ones.
-   Each chapter has been transformed into a standalone module, enabling
    learners to create small projects from scratch within each chapter.
-   The screenshots/text/code have been updated for Odoo 17.

Currently we have 5 chapters:
- Discover Chapter 1 - Owl Components: This chapter allows to learn the
  Owl framework in the `awesome_owl` module.
- Discover Chapter 2 - Build a dashboard: This chapter allows to grasp
  the basic of the web framework by building a dashboard in the
  `awesome_dashboard` module.
- Master Chapter 1 - Build a clicker game: This chapter allows to grasp
  the web framework by building a clicker game in the `awesome_clicker`
  module.
- Master Chapter 2 - Create a gallery view: This chapter allows to learn
  how to create a new view type. The new view is a gallery of records
  pictures. It can be done in the `awesome_gallery` module.
- Master Chapter 3 - Customize a kanban view: This chapter allows to
  learn to customize a kanban view by implementing a list of customer in
  the side of a kanban view. This can be done in the `awesome_kanban`
  module.

The chapter on creating and customizing fields is deleted for now and
will be completely rewritten in a near future.
The chapter on testing is deleted, how-to guides will be written to
cover this subject.

The solutions for all exercises has been done for v17, the goal by
merging the new tutorial is to have this new branch structure in
`odoo/tutorials`:
- 16.0
- 16.0-solutions
- 17.0
- 17.0-discover-js-framework-solutions
- 17.0-master-odoo-web-framework-solutions
-   master <-- default branch, starting point for all addons
-   master-discover-js-framework-solutions
-   master-master-odoo-web-framework-solutions

closes odoo/documentation#6876

Task-id: 3623595
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-12-18 23:31:55 +00:00
Xavier Morel
2e595b52b4 [IMP] developer reference: update t-debug doc
The value of `t-debug` is now optional, and leaving it out means the
directive just invokes the `breakpoint` builtin, which was added in
3.7 and is configurable via an envvar or a hook callable.

closes odoo/documentation#5800

Related: odoo/odoo#134842
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-11 10:29:03 +00:00
Gorash
83c2012f95 [IMP] reference: rewrite and move views documentation to user_interface/
The documentation of the views is redone in order to be up to date and
has allowed a better visualization of the task on the modifiers.

task-2495504

closes odoo/documentation#3523

Related: odoo/odoo#104741
Related: odoo/enterprise#35255
Related: odoo/upgrade#4884
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-08-18 09:49:36 +02:00
imanie383
f4e7830a92 [FW][FIX] reference/owl_components: fix typo
Making edits for Owl Components Doc : [Link](https://www.odoo.com/documentation/16.0/developer/reference/frontend/owl_components.html#example-multi-level-dropdown-nested)

![image](https://github.com/odoo/documentation/assets/35231827/b2dd4b87-941c-4241-b0f5-e91ca69b3633)

closes odoo/documentation#5475

Forward-port-of: odoo/documentation#5459
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-08-11 22:50:14 +02:00
Samuel Degueldre
eb63fd7629 [IMP] remove references to owl template tagging
In odoo/odoo#130467 the necessity to tag owl templates with an owl="1"
attribute has been removed, update the docs to reflect that.

closes odoo/documentation#5460

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-08-11 19:34:53 +02:00
Michael (mcm)
775e80ed92 [IMP] web: update documentation of patch function
This commit updates the documentation of the patch function
with the changes done in https://github.com/odoo/odoo/pull/125716.

closes odoo/documentation#5017

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-08-03 16:07:00 +02:00
Marc Durepos
9988d0b214 [FIX] Remove reference to assets_qweb in assets.rst
Reflects the fact that assets_qweb bundle is no longer used in 16.0

closes odoo/documentation#5109

X-original-commit: c85031b3fc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-13 19:28:18 +02:00
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
Julien Mougenot
a9c82ebb94 [REF] web: update JS fields documentation
This commit updates the documentation of JS fields:

- style and notation have been adapted to keep in line with the current
documentation writing guidelines;

- some outdated bits have been updated or removed (this is rather a
correction of misleading information than a proper update as no new
information has been added).

Part-of: odoo/documentation#5013
2023-07-04 12:47:01 +02:00
Rémy Voet (ryv)
13544bca17 [IMP] orm: name_get into display_name
odoo/odoo#122085
odoo/enterprise#42599
odoo/upgrade#4780

closes odoo/documentation#4639

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-06-28 17:41:15 +02:00
luvi
898b0280db [IMP] web: add documentation for Core components
This commit adds some documentation for features recently added to SelectMenu
and TagsList components during the saas-16.3 development. A screenshot has
been provided to the advances use case of the SelectMenu, with a customization
of the bottom area of the dropdown, to create display a button allowing the
creation of items.

closes odoo/documentation#4631

X-original-commit: 0aad6eafda
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-06-06 14:48:43 +02:00
Mathieu Duckerts-Antoine
70b69857e9 [IMP] abstract actions: adapt code after some legacy code removal
closes odoo/documentation#3722

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-17 14:46:58 +02:00
Antoine Vandevenne (anv)
8c29d1fd6a [FIX] reference/services: mark optional the params parameter of rpc
closes odoo/documentation#4282

X-original-commit: c1b38dc1f3
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-04-27 18:25:21 +02:00
Martin Trigaux
1e39949363 [IMP] reference: update markup documentation
closes odoo/documentation#3612

Related: odoo/odoo#111850
Related: odoo/enterprise#36728
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-04-13 16:39:45 +02:00
fdardenne
56a5b0480e [IMP] create JavaScript howtos
The JavaScript cheatsheet is outdated, we therefore remove it and
replace it by multiple howtos:

- Create a view from scratch
- Extending an existing view
- Create a field from scratch
- Extend an existing field
- Create a client action

There is other subjects to introduce as the web framework is big. Other
future contributions will cover them.

closes odoo/documentation#4020

X-original-commit: 7e4435deb8
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-04-05 13:57:53 +02:00
luvi
5e248b7017 [IMP] web: Add core components documentation
This commit adds the documentation for core components that have
been improved or moved during the Studio refactor. Some new props
have been added, and the documentation is now present as expected.

Components involved:
- Notebook
- SelectMenu
- TagsList

closes odoo/documentation#4007

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-04-04 18:07:11 +02:00
Géry Debongnie
f6ce2b9904 [IMP] developer: add description of disabled prop to Dropdown
This prop has been implemented in pr https://github.com/odoo/odoo/pull/115201/files

closes odoo/documentation#3828

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-14 17:03:41 +01:00
Jonathan Castillo (jcs)
65d71dd7be [FIX] *: RST cleanup
RST cleanup to comply with the RST guidelines. This is required so we
can use "make test", as there are currently hundreds of errors. For now,
it is unusable because of the oldest code in this repo.

closes odoo/documentation#3589

X-original-commit: 7ae76bad42
Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
2023-02-15 16:03:06 +01:00
luvi
f4c8a0f929 [ADD] web: add core components documentation
Those components were added during the Owl rewrite of the webclient
that happened in 16.0. Unfortunately, there was still no documentation
for them.

This commits fixes that by adding documentation for the Notebook and
the Colorlist components.

closes odoo/documentation#3586

X-original-commit: 7a9d807bcc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-15 16:03:03 +01:00
luvi
a844c0aa12 [ADD] web: add SelectMenu documentation
This commit adds the documentation for the SelectMenu component, introduced
in saas-16.1. This documentation gives some example of its usage.

An image is also added, to better illustrate the grouping functionality.

closes odoo/documentation#3575

X-original-commit: 4a220d61fe
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-14 18:12:04 +01:00
luvi
128bc1786c [FIX] web: fix wrong ActionSwiper documentation
Since 16.0, the documentation for this component was no longer
correct, since the component was moved to web during the refactor
of the webclient views. This commit also adds documentation of
props that were introduced during the refactor, already present
in 16.0.

closes odoo/documentation#3507

X-original-commit: fc79df42fd
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-08 16:50:05 +01:00
Mahmoud Metwally
c61c65da47 [FW][FIX] developer/javascript_reference: typos and phrasing
closes odoo/documentation#3476

Forward-port-of: odoo/documentation#3470
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-03 06:06:29 +01:00
stefanorigano (SRI)
9571a32131 [IMP] scss: update, improve preexisting content
Add a new content focused on SCSS and user-interface.

- SCSS coding guidelines: regroup information already available (eg [1])
  or based on "oral tradition".
  The aim is not to establish new rules, ~99% of the current codebase
  is already compliant.

- SCSS inheritance: explain how SCSS assets management works in odoo.
  For example, people still find confusing that overrides are defined
  *before* the variable to customize.

- SCSS optimization tips: suggestions to lean SCSS code. Based on SCSS
  optimization task's know-how [2].

- CSS variables: explain how this feature is commonly used in odoo to
  adapt layout & design without raw CSS overrides.

- UI Icons: Add link to fontAwesome4 library . Replace the picture of
  odoo icons with the actual font (90kb image VS 15Kb font)

[1] https://github.com/odoo/odoo/wiki/SCSS-coding-guidelines
[2] https://www.odoo.com/web#id=2704984&menu_id=4720&cids=1&model=project.task&view_type=form

task-3090800

closes odoo/documentation#3327

X-original-commit: 2ca32b40bc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-13 17:33:02 +01:00
fdardenne
8a30786495 [IMP] developer: JavaScript tutorial: chapter 3-7
This commit adds the chapter 3,4,5,6 and 7 of the JavaScript web
framework tutorial.

This new tutorial allows people to discover Owl and the building blocks
of the Odoo JavaScript framework.

closes odoo/documentation#3325

X-original-commit: 54628b4f5b
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-12 19:08:49 +01:00
Horacio Tellez
d8c9f6afa4 [FIX] developer: typo on a code example in the framework overview
There was a variable being used that was undeclared.

closes odoo/documentation#3316

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-11 15:39:02 +01:00
luvi
ad6cde3181 [IMP] web: update usePosition API
This commit updates the documentation of the position hook, to add
the latest variant "fit". This variant was introduced recently in
commit (1), when using it in the SelectMenu component.

(1): c21c415f38

closes odoo/documentation#3261

Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-01-09 12:22:44 +01:00
luvi
bca9ac151f [ADD] web: add useSpellCheck hook documentation
This commit brings the documentation for the useSpellCheck hook,
introduced in commit (1). The documentation contains some example
and details on how to use the hook properly.

(1): 130719e584

Part-of: odoo/documentation#3261
2023-01-09 12:22:44 +01:00
Mahmoud Metwally
1a95d1cd6f Update qweb.rst
closes odoo/documentation#3289

X-original-commit: 8cde1f7b74
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-04 15:48:18 +01:00
Antoine Vandevenne (anv)
b3a1f27461 [IMP] conf.py, *: interpolate the version and releases in the content
This commit replaces hard-coded occurrences of the version and of the
last, current and next releases' version with placeholders interpolated
at build time to avoid manually updating these after each freeze.

task-2917614

closes odoo/documentation#3170

X-original-commit: fa2d0f6363
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-09 13:03:46 +01:00
Victor Feyens
2d1361c026 [FIX] developer/*: code blocks linting & fixes
invalid xml
invalid python
correct indentation

closes odoo/documentation#3029

X-original-commit: b2121b7891
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-25 10:52:04 +01:00
Victor Feyens
2b75fb4bbb [FIX] developer/*: consistent code-block language specification
X-original-commit: 387cf15e7f
Part-of: odoo/documentation#3029
2022-11-25 10:52:04 +01:00
Ivan Kropotkin
6c7ee83bc4 [FW][FIX] developer/reference: code example
closes odoo/documentation#3028

Forward-port-of: odoo/documentation#2943
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-24 19:25:27 +01:00
Victor Feyens
17fa2e0333 [FIX] developer/mobile: use spaces and not tabs for indentation
closes odoo/documentation#2984

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-18 18:04:50 +01:00
Victor Feyens
197dbea3d2 [FIX] *: unbalanced literal markups
Part-of: odoo/documentation#2984
2022-11-18 18:04:50 +01:00
Victor Feyens
c2f8d4bd44 [FIX] *: remove trailing whitespaces
Part-of: odoo/documentation#2984
2022-11-18 18:04:50 +01:00
Victor Feyens
c60bc5f919 [FIX] *: enforce 1 newline on files end
Part-of: odoo/documentation#2984
2022-11-18 18:04:49 +01:00
Antoine Guenet
390126a28a [ADD] frontend: documentation for the editor's Powerbox
This adds a simple documentation for the editor's Powerbox and creates
the base for the editor's own documentation in general.

closes odoo/documentation#2586

Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2022-08-19 11:52:46 +02:00
poma-odoo
ab03f8a9f3 [FW][FIX] developer/frontend: small typos
closes odoo/documentation#2610

Forward-port-of: odoo/documentation#2584
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-18 18:25:46 +02:00
Antoine Vandevenne (anv)
5244bd6e23 [IMP] developer/javascript: unify the styling of API references
Now that a new styling for API references was added with commit 934f45c,
we can remove the extra CSS that was crafted specifically for JavaScript
API references with commit 05a0a49a. While we're at it, this commit also
applies the new styling to definition lists that were missing it, like
it was done for the page on views with commit 120ae785.

closes odoo/documentation#2378

X-original-commit: 31a9d4a340
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-04 17:47:40 +02:00
Gorash
7c4656f0c4 [IMP] qweb: document 't-cache' and 't-nocache' directives
related with: https://github.com/odoo/odoo/pull/88276

closes odoo/documentation#2056

Related: odoo/enterprise#27582
Related: odoo/upgrade#3451
Related: odoo/odoo#88276
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-03 16:40:21 +02:00
Antoine Vandevenne (anv)
8722ea902e [MOV] content/*: move resource files into their related page's directory
Since odoo/documentation#903, the guideline for the location of new
resource (images, downloadable files, RST includes...) files is to place
those inside the directory of the RST page that references them.

For example, if `doc1.rst` has a reference to `image.png` and to
`download.zip`, the file structure should look like this:

├── parent_doc/
│     └── doc1/
│     │     └── image.png
│     │     └── download.zip
│     └── doc1.rst
│     └── doc2.rst
├── parent_doc.rst

Before this commit, most of the resource files were still located inside
'media' directories holding all the resource files referenced by RST
pages located at the same level as these directories. In the example
above, a single 'media' directory would hold all the resource files
referenced by both `doc1.rst` and `doc2.rst`. Doing so prevented us from
figuring out easily which resource file was referenced by which RST page
and, thus, lead to unused resource files piling up in the repository. It
also made it more complicated to define codeowners regex rules because a
team could not simply be assigned to `/some_page.*` but needed to be
assigned to both `/some_page\.rst` and to the location of 'media'.

In order to help new content writers figure out the guideline when
taking examples from other RST pages, this commit retroactively applies
the guideline to existing resource files and 'media' directories. The
left-over resource files that are not referenced by any RST page are
removed.

task-2497965

Part-of: odoo/documentation#2068
2022-05-20 14:18:54 +02:00
Beshoy Nabeih
d5d232bb50 [FIX] developer/frontend: typo in the user menu registry example
closes odoo/documentation#2039

X-original-commit: 6d30d81a76
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-19 18:06:18 +02:00
John Kirkwood (kij)
ded1e69553 [IMP] developer: clarify options for many2one widget
Only `no_create` is required to hide both the 'Create "xxx"' and the
'Create and Edit...' dropdown menu options.

closes odoo/documentation#2016

X-original-commit: 599a137ffc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-18 16:05:03 +02:00
wan
889c9cf0f9 [REF] i18n/localization.rst: rework the entire localization tutorial
closes odoo/documentation#1969

X-original-commit: 9db567159d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: William Andre <wan@odoo.com>
Co-authored-by: Ivan Yelizariev <iel@odoo.com>
2022-05-09 14:03:24 +02:00
Bruno Boi
0c0a7086ac [IMP] hooks: usePosition new API
closes odoo/documentation#1598

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-03-21 10:15:16 +01:00