The `waitUntilEvent` start helper parameter has become obsolete. Indeed,
events are systematically awaited by the `openDiscuss`/`openView`
helpers. This commit removes this parameter.
closesodoo/odoo#99577
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this PR, some mail tests relying on DOM elements being present
but that are added after the messaging initialization could fail
unpredictability. This commit fixes this issue by waiting the next
render following the initialization of messaging.
closesodoo/odoo#99461
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.
We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).
[1] odoo/odoo#92475
Part-of: odoo/odoo#78221
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>
*: 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
closesodoo/odoo#95824
Related: odoo/enterprise#29361
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Probably introduced in PR changing rendering of chatter in form renderer that
changed timers in unfortunate situations.
Open form view utils was missing an await on (chatter container) render, but the
issue was not perceptible before.
closesodoo/odoo#95003
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
*: sms, snailmail.
The createThreadViewComponent helper was used during tests to mount
a thread view component and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the thread view
component can be mounted in its real environment.
task-2871066
closesodoo/odoo#94691
Related: odoo/enterprise#28954
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: im_livechat, website_livechat.
The autoOpenDiscuss parameter was used but is deprecated for a while now.
This PR removes it.
closesodoo/odoo#94716
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The createMessageComponent helper was used during tests to mount
a message component and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the message component
can be mounted in its real environment.
closesodoo/odoo#94243
Related: odoo/enterprise#28720
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The createChatterContainer helper was used during tests to mount
a chatter container and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient and open a form view
containing a chatter.
closesodoo/odoo#94175
Related: odoo/enterprise#28684
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: im_livechat, test_mail, test_mail_full.
The createMessagingMenu helper was used during tests to mount
the messaging menu and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's instanciate a webClient and a systrayService
for the messagingMenu to be present at all time.
closesodoo/odoo#94301
Related: odoo/enterprise#28747
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* hr, im_livechat, mail, sms, snailmail, test_mail_full, website_livechat,
website_slides
PURPOSE:
Creating a record with no values has no sense but is sometimes useful during
tests.
The support should be dropped for `default` parameter in `create`.
SPECIFICATION:
All the occurrences of `create()` have been replaced by `create({})`.
Task-2869394
closesodoo/odoo#93917
Related: odoo/enterprise#28538
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This will reduce memory leak size in tests. But the proper fix should be lower
level in the code (probably in Owl according to the stack) to ensure unnecessary
references aren't kept anymore.
Part of task-2850875
closesodoo/odoo#90934
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This will reduce memory leaks in tests.
Indeed `destroy` is not a standard service method, it must be called manually.
And references to messaging service were unnecessarily kept in env.
Note: ideally everything should be cleaned this way, not just messaging code.
In other words, env itself should have no retainers at the end of each test, but
completely removing all of them is a much bigger work that is outside of the
scope of this PR.
Part of task-2850875
Part-of: odoo/odoo#90934
No container should be registered as messaging component. ChatterContainer is the
last one registering itself as such. This PR solves this issue.
closesodoo/odoo#92541
Related: odoo/enterprise#27905
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Top level components should always be wrapped in containers since they have to receive
a record comming from messaging. To do that, we need to wait for messaging to be initialized.
In the PR introducing the new environment in the discuss app, some of those components will
be passed to the main_component registry, messaging won't be ready yet. In order to ease the
transition, the last components missing a wrapper have been wrapped.
task-2582313
closesodoo/odoo#92402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Since (at least) Chrome 94+, some element's sizing computation returns a
slightly different value (in the order of a fraction of a pixel). Sadly,
due to rounding, this difference has an impact on exact sizing
assertion.
As the difference is *really* small, introducing a margin of error (i.e.
<= 1px) looks reasonnable ; as implemented in this commit. More
specifically as Element.scrollHeight can have either an int or a decimal
value (cf. fractional-scaling), this commit allows to property handle
both usecases.
Reference:
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolledclosesodoo/odoo#92328
X-original-commit: 93348ae0d0b076fe2dfa094a2d7b3ef74442d390
Related: odoo/enterprise#27790
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
*: hr, hr_holidays, im_livechat, test_mail.
The target returned by the mail's test utils start method is useless since it's
almost the same thing than querying document. Let's remove it and replace it by
document. This will reduce the diff in the PR introducing the new environment in
the discuss app.
task-2582313
closesodoo/odoo#92077
Related: odoo/enterprise#27670
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, note, test_mail.
This PR prepares the ground for the one introducing the new environment in the discuss app.
Indeed, the start helper won't be able to handle widget anymore. To solve this issues,
we're now adding the activityMenu widget to the systrayMenu.Items array, this will be
mapped by the createWebClient helper to component and added to the new systray item
registry.
task-2582313
closesodoo/odoo#91953
Related: odoo/enterprise#27614
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Until now, when we add to patch the ui size, we would have patched one of the following:
- config.device.{isMobile,size_class}
- (wowl) env.isSmall / env.services.ui.{isSmall/size}
- (legacy) env.device.isMobile
- (legacy/wowl) browser.innerWidth
The issue is that patching one does not affect the others resulting in an incoherent state.
In order to ease ui size patching, the `patchUiSize` method has been introduced. This method
take either a size or a width as parameter (eg. SIZES.SM, 1920) and affect all the properties above.
task-2582313
closesodoo/odoo#91540
Related: odoo/enterprise#27428
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR prepares the ground for the one introducing the new environment in the discuss app.
Indeed, switching from `env.browser` to the wowl `browser` makes a lot of noise in the main
PR. In order to reduce this noise, this change is done now.
task-2582313
closesodoo/odoo#91622
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR prepares the ground for the one introducing the new environment in the discuss
app. Indeed, the discuss widget will be removed since it was used as an action. This widget
basically handle two things: rainbowman on empty inbox/push state. This second part focuses
on the push state aspect.
task-2582313
closesodoo/odoo#91450
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: im_livechat, website_livechat.
In order to reduce the noise in the PR introducing the new environment in
the discuss app, calls to widget.call, env.bus_service.call during tests
have been replaced by a mocked implementation of _sendone/_sendmany. Moreover,
this approach will allow us to mock the longpolling during tests, resulting in
a more realistic behavior.
task-2582313
closesodoo/odoo#90724
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Now that pyEnv is available, using it in the mock_server lighten the syntax.
task-2582313
closesodoo/odoo#90783
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR helps reducing the noise in the one intorducing the new environment
in the discuss app. Indeed, there won't be widget anymore since createWebClient
will always be used. createXXXComponent methods were relying on widget.el to
mount the components. Let's already replace it by target.
task-2582313
closesodoo/odoo#90526
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: hr, im_livechat, snailmail, website_livechat.
This PR prepares the ground for the one introducing the new environment in the
discuss app. Indeed, tests will now use the mainComponentRegistry in order to mount
those components. Doing so, the parameters has{Discuss/Dialog/ChatWindow} will become
obsolete. Removing those parameters now helps reducing the noise in the main PR.
task-2582313
closesodoo/odoo#90120
Related: odoo/enterprise#26759
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR prepares the ground for the introduction of the new environment in the discuss
app. For now, the start method adds the advanceTime function to the environment. The issue
is that the new env is not extendable. This change makes a lot of noise hence the prep PR.
task-2582313
closesodoo/odoo#89888
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, hr_holidays, im_livechat, note, website_livechat.
This PR helps reducing the noise in the discuss new env PR. Indeed,
the new mockServer has the same method except that they are not prefixed
by any underscore. All calls have been changed, and the corresponding
methods created. They will be deleted later.
task-2582313
closesodoo/odoo#89659
Related: odoo/enterprise#26603
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR prepares the ground for the new env in discuss. The addTimeControlToEnv
function has been move in its own file, it will not rely on env anymore.
task-2582313
closesodoo/odoo#89673
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.
Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.
Task-2579306
closesodoo/odoo#88878
Related: odoo/enterprise#26277
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The get_model_definitions method returns default values for each field. Those default
values are wrong most of the time (dynamic values, reference to non created records on
the client side, ...).
task-2792108
closesodoo/odoo#87641
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
startServer method ease data seeding by providing an environment that
can be used to interact with the underlying mock server.The createWebClient
method was not supported well. Indeed, we could either pass serverData or not.
But we could not pass only the views and take the data from the startServer
method. This issue was addressed.
task-2792108
closesodoo/odoo#87432
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>