Commit Graph
32 Commits
Author SHA1 Message Date
Mathieu Duckerts-AntoineandMichaël Mattiello c1436ba8ca [IMP] *: advanced search
We allow edition/creation of domains with a domain selector via the
search bar facets or the menu "Add Custom Filter".
The domain selector has also been improved and now support expressions
and a new operator "between" for some field types (those for which <=
and >= are valid operators). We also improve the support of the connector
not.

Task ID: 3063564

closes odoo/odoo#112326

Related: odoo/enterprise#37715
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-05-08 15:18:03 +02:00
Michael (mcm) 8da2b52333 [IMP] web: introduce overlay service
This commit adds a new service "overlay" that will be used as a base
for other service which displays a component on foreground like
"popover" or "dialog". The services "popover", "dialog" and "effect"
already uses this new service to have a common container.

The "overlay" service also fix a stacking context issue that could
happen when a popover opened a dialog and this dialog then opened
another popover thanks to the common container.

task id: 3233266

closes odoo/odoo#115308

Related: odoo/enterprise#38786
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-03-30 16:22:51 +02:00
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00
Aaron Bohy 8fc4c6f2d8 [REF] *: remove legacy views support
The last view in the odoo codebase has just been converted to owl,
meaning that we no longer have legacy views. This allows us to
remove a lot of legacy view related code: the abstract elements on
which the legacy views were built, the compatibility layers that
allowed to deal with both owl and legacy views uniformly, legacy
widgets that were only used in those legacy views...

closes odoo/odoo#114893

Related: odoo/upgrade#4420
Related: odoo/enterprise#38005
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-10 13:33:04 +01:00
Samuel Degueldre ef67615e97 [FIX] web: correctly destroy apps created for legacy MockServer
A recent change in owl exposes live (non-destroyed) apps on the window.
This change causes the memory used by the QUnit test suite to balloon
out of control. The reason is that when creating a mock environment, we
create a standaloneAdapter to serve as the legacy MockServer's parent,
but this standaloneAdapter creates a dummy owl application and this
application is never destroyed. This commit fixes the problem by
registering a cleanup to destroy the application at the end of the
running test.

closes odoo/odoo#110889

X-original-commit: 27ff522cd6b0c3be32be623e375052e63bb1a04f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-25 08:18:04 +01:00
Joseph Caburnay c412f11c02 [REF] web,web_*: import owl features using "@odoo/owl" module
In @odoo-module files, we do the following conversion:

`const { ... } = owl;` -> `import { ... } from "@odoo/owl"`.

While in legacy odoo module (odoo.define):

`const { ... } = owl;` -> `const { ... } = require("@odoo/owl");`.

closes odoo/odoo#104260

Task-id: 3032274
Related: odoo/enterprise#33298
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-27 14:41:17 +02:00
Bruno Boi 0ae158bf43 [LINT] web
closes odoo/odoo#99295

Related: odoo/enterprise#30900
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-31 18:53:51 +02:00
tsm-odoo 9d86827840 [IMP] bus, *: only use one mock server during tests
*: mail, web.

The pyEnv used during tests is based on the mock server to provide
server like api. This issue is that when creating multiple environments
during tests, a new mock server is created each time. This is not realistic
since in a real world scenario, multiple tabs would share a single server.
In order to make pyEnv work with multiple tabs tests (e.g. multiple env tests),
let's create a single mock server shared between js environment during a test.

task-2053917

Part-of: odoo/odoo#97975
2022-08-12 23:37:38 +02:00
tsm-odoo d998c54feb [FIX] mail, bus: fix mock sendone/many crash during tests
The mock of sendone/many was relying on the bus_service. Since owl.Component.env
is changing during tests setup, the bus_service was not always defined. In order
to make this more reliable, the longpolling/poll route is now mocked, returning a
promise that can be resolved by the sendone/many methods.

closes odoo/odoo#97298

Related: odoo/enterprise#30059
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-05 16:35:45 +02:00
Lucas Perais 6c155e1713 [FIX] web: relationalModel: basic keys supported in record context
Have an editable list view, displaying a many2many tags field. The m2m field
has a context, mentioning `active_id`. (`context="{'default_field': active_id}"`)

"basic context keys" is to be understood as the usual suspects: active_id, active_ids, current_company_id, active_model

Type something in the m2m input, and selet create and edit, in order to create a new record in a dialog form view.

Before this commit, there was a crash because active_id was not present in the evaluation context.

After this commit, the new record opens in its form view, with the right value for the field that must have a default.

closes odoo/odoo#96910

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-04 18:35:32 +02:00
Matthieu Stockbauer 3ae11c87e8 [IMP] mail, *: adapt bus service to wowl env.
*: bus, calendar, iap_mail, im_livechat, project, web.

In order to ease the PR introducing the websockets in Odoo, the bus service
has to be updated to be a wowl service. This PR takes care of it.

task-2053917

closes odoo/odoo#95824

Related: odoo/enterprise#29361
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-14 11:42:42 +02:00
+2 48ef812a63 [REF] web: kanban, list and form views in owl
This commit introduces the new kanban, list and form views written
in owl. Even though it contains the implementation of those 3 views,
only the kanban view is activated for now (the list and form views
aren't 100% ready yet, so they aren't added to the view registry).

Alongside the views, the fields (<field name="..."/> in archs) and
widgets (<widget name="..." in archs) of web/ have been implemented
in owl as well. Legacy ones remaining in other addons are supported
in our new views, thanks to a compatibility layer. The goal is to convert
them asap though.

Legacy views, fields and widgets are kept for now, which explains the
number of added lines in this PR (around half of them concern tests).
They are still extended by custom code in other addons, that still need
to be converted (a lot of them are already on the way). Moreover,
they are still used in Studio as well. The plan is to lazy load them in
the Studio bundle when all custom code extending them will be
converted. Studio will be converted for v17.

Part-of: odoo/odoo#92475
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-06-30 09:29:44 +02:00
Aaron Bohy a715e63b88 [IMP] mail,web: tests: crash if triggerEvent called on invisible el
Before this commit, the test utils that trigger an event (e.g.
click) didn't check whether the target of the event was visible.
As a consequence, when writing a test, one might trigger an event
on an invisible and undesirable target, and don't understand why
it doesn't work due to the absence of feedback. This commit
improves that situation by throwing an error in those sitations.

Obviously, some tests relying on the former behavior needed to
be slightly adapted.

closes odoo/odoo#93549

Related: odoo/enterprise#28360
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-06-14 22:07:08 +02:00
tsm-odoo 3573a7fef4 [IMP] mail, *: use wowlEnv instead of the legacy one
*: bus, calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, project,
sms, snailmail, test_mail, web, website_livechat, website_slides.

task-2582313

closes odoo/odoo#83774

Related: odoo/enterprise#26493
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-30 19:40:53 +02:00
tsm-odoo c23f85903a [IMP] mail, *: use pyEnv in the mockServer
Now that pyEnv is available, using it in the mock_server lighten the syntax.

task-2582313

closes odoo/odoo#90783

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-13 11:59:58 +02:00
Aaron Bohy f573e93bb2 [REF] web,mail: adapt code to new load_views API
Part-of: odoo/odoo#87522
2022-04-29 09:57:44 +02:00
8a5721bc7d [REF] web: remove LegacyComponent
Before this commit, components used `el` and `trigger` but this works
thanks to LegacyComponent. LegacyComponent has been introduced to ease
the transition from owl 1 to owl 2.

This commit replaces the uses of `el` by `useRef` and `trigger` by
adding callback in props. Without these owl 1 features, components
no longer need to extend LegacyComponent.
This commit also adapts the tests to use `getFixture` instead of `el`.

closes odoo/odoo#85903

Related: odoo/enterprise#25032
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-03-08 09:08:54 +00:00
Michael (mcm) 4dc2b2e539 [REF] web: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.
Some tests are updated to have less LegacyComponent.

Part-of: odoo/odoo#85389
2022-03-01 09:57:39 +00:00
+2 6d13271aac [REF] web: adapt code to owl 2
Owl 2 changelog: https://github.com/odoo/owl/blob/a9f29c4caad4f32d06be1ec4780572825781cd9b/CHANGELOG.md

Part-of: odoo/odoo#80156
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-02-10 07:46:12 +00:00
Julien Mougenot db63ff2259 [REF] web: Owl imports adaptation
In the next version of Owl, all exported terms are directly available
from the top level `owl` object. This commit aims to adapt existing
imports to this new system. This is done by importing any Owl property
used in files at the top, right after the `import` or `require`
statements.

closes odoo/odoo#82736

Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-20 11:03:01 +00:00
Michael (mcm) 13686e0e19 [IMP] web: http service in webclient test helper
Before this commit, `setupWebClientServiceRegistry` didn't use
http service but some tests need it.

Part-of: odoo/odoo#76472
2021-11-02 10:45:15 +00:00
36988d0edc [IMP] *: use new dropdown in legacy too
This commit replaces the control panel dropdowns with the new <Dropdown/> component, in order to get consistent through the new/legacy views (because the current Odoo version is in a state where some views uses the new infrastructure and some others are still not converted - see odoo/odoo#73311).

The diff seems massive, but it is mostly due to tests adaptations.

closes odoo/odoo#77001

X-original-commit: d679cd0d8ba9a2420e81a42a698763e9be2327e1
Related: odoo/enterprise#21077
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-09-23 07:17:43 +00:00
Francois (fge) e0e4d38cdd [MOV] web: move /commands to /core
We move /commands to /core because DebugMenu depends
on /command/command_hook. All the files in /commands depend only
on /core or /commands except for menu_providers which we will move to /menus

X-original-commit: eca8cd478b72d81b2293c22d2c9c41d1f94be16a
Part-of: odoo/odoo#76777
2021-09-17 23:59:19 +00:00
aeb8e49972 [IMP] web,*: view infrastructure
We refactor the action service and allow the legacy and new views to share
a global state within a same action.

We introduce two new components View and WithSearch along with
the search infrastructure: ControlPanel, FilterMenu,...

Part-of: odoo/odoo#73311
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
2021-09-07 10:04:35 +00:00
Francois (fge) dca9ca6464 [IMP] web: refactor debug commands
Rename `Debug Menu` => `Debug tools...`
Remove `Debug tools...` hotkey

The commands in the debug category need to have a search value
to be displayed.

Task-id: 2622240
Part-of: odoo/odoo#74933
2021-08-26 13:56:14 +00:00
Samuel Degueldre 1eeab1e418 [REF] web: remove legacy rainbowman
The frontend code was still using the legacy RainbowMan, with the wowl
webclient, we rewrote this RainbowMan and started using that one
instead, but because the frontend code had no access to the wowl
environment, the legacy version was still used in the frontend. Since
the frontend now has access to the wowl environment, the old code can be
removed and the calls can go through the new effect service.

closes odoo/odoo#74148

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-23 12:14:10 +00:00
Lucas Perais (lpe) 23da5621f3 [FIX] web: router_service: concurrent hashchange
Do an action that will change the hash.
During this, change the url hash to load another action

Before this commit, the hash taken to load the second action was wrong, because the first
action pushed its state instants before the hashchange event is actually triggered.
This is because the hashchange event is triggered in a non blocking stack
(https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-fragid)

After this commit, the right action is loaded with the right hash

closes odoo/odoo#72878

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-07 09:16:38 +00:00
Lucas Perais (lpe) 832ce8d1f9 [FIX] web, mail: test helpers: fix legacy interactions
The new execution environment of wowl tests has to take into account that legacy objects
can be spawned below it and around it, in particular in mail tests where mail has to create
an owl environment with the right keys.

This commit aims at making this work namely by being to pass an already formed legacyEnv
to the createWebClient helper
2021-06-18 21:31:34 +02:00
Lucas Perais (lpe) c65e57e17b [REF] web: ui_service and block UI in @web/core/ui/
closes odoo-dev/odoo#925

Related: odoo-dev/enterprise#166
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:33 +02:00
Bruno Boi aab6f88439 [MOV] web,base_automation: hotkeys from webclient/ to core/
The hotkeys feature is a core feature, not only useful for the webclient.

closes odoo-dev/odoo#942

Related: odoo-dev/enterprise#172
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-18 21:31:32 +02:00
Mathieu Duckerts-Antoine 9c05de391e [IMP] *: remove makeFakeUIService helper
The behavior of some components like the Dropdown component depends on the ui service that records
(among other things) what is the "active" element in the page. For instance a dropdown can close/stays open under
certain circumstances if it is in the active element or not. The fake ui service created by makeFakeUIService
was not managing properly the active element. Since we want to avoid code duplication and that there was no real
need for a fake ui serice, we simply drop the helper makeFakeUIService and use the real ui service everywhere.
2021-06-18 21:31:31 +02:00
Aaron Bohy a5091fee99 [REF] *: rework webclient test helpers
This commit splits the 'getActionManagerTestConfig' helper into 2:
'setupWebClientServiceRegistry' and 'getActionManagerServerData'.

The first one is now automatically called by the 'createWebClient'
helper, as it properly setups the service registry with all services
required by the WebClient component.

The second one generates a few data (menus, actions, views...) that
can be used in tests. That helper is mainly useful for action tests
(formerly ActionManager tests) in web. With this refactoring, they
are no longer generated for each test in the whole codebase that
spawns a webclient, as before this commit.

closes odoo-dev/odoo#906

Related: odoo-dev/enterprise#161
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:30 +02:00