This commit simplifies the SCSS of the command palette component.
task-2748052
closesodoo/odoo#83938
Signed-off-by: Pierre Paridans (app) <app@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>
In preparation of test adaptation after introducing a new way to
seed test data, the fake model present on the m2x avatar user test
have been registered to the model definitions instead of being
declared on it's test.
task-2792108
closesodoo/odoo#87433
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The group_public_id and group_id and subscription_department_ids
should only be used when the channel_type is 'channel'.
task-2766712
closesodoo/odoo#84813
Related: odoo/upgrade#3266
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
There were inconsistencies in the calls to `_render`.
* the view context could contain information that misled developers.
Indeed, the context and value of the view are not supposed to be found
in the rendering. Thus by calling `ir.qweb` with the name of the
template, we ensure that there is no unwanted information and in
addition the cache key is that of the name of the template which saves
a query.
* the context used for rendering was modified by a method on
`ir.ui.view`, except this is not information used by this model. There
is now a `_prepare_environment` method residing on `ir.qweb`. This
method allows to modify the value dictionary as well as the context in
which the rendering will be done. This preparation of the data as well
as my security check is done only once per rendering. This also saves
some queries
* Freeze options for rendering were inconsistent. It could be that
options on which rendering depends were not part of the cache key. Thus,
depending on the user who generated the generation of the rendering
function, there was or was not information in the template. For example
for automatic branding. This is no longer possible, because it is the
context that is used. The options serving as a cache key are only
recorded for information (for the profiling system for example). A
simplification of the `ir.qweb.field` models could be made.
The report rendering and call `ir.qweb` instead of `ir.ui.view`.
Part-of: odoo/odoo#85110
This PR adapts mail components tests after the introduction
of a new way to seed test data.
task-2792108
closesodoo/odoo#86655
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This is exactly the field 'RtcSession/isConnected', but it was badly named.
Task-2734101
closesodoo/odoo#87284
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: web, website_slides.
Specifying both side of a relation when seeding test data is cumbersome.
Let startServer method handle it.
task-2792108
closesodoo/odoo#86939
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This fixes two problems that occur with conditions on many2many fields:
the subtle bug caused by NULL values that are returned by subqueries,
and the performance of those subqueries.
The problem with NULL values returned by subqueries is the fact that
they make the SQL condition undetermined instead of false, and this
discards some of the results returned by a query. Simply consider:
id NOT IN (1, 2, 3)
The value id=3 makes the condition false, while i=4 makes it true. Now
consider that the set also includes a NULL value, like:
id NOT IN (1, 2, 3, NULL)
The value id=3 makes the condition false, but the value id=4 makes it
undetermined. Therefore this condition is actually undetermined for all
possible values of id, and a query containing that condition simply
returns nothing!
Regarding performance, consider a domain like [('tag_ids', '=', False)].
It is currently translated in SQL as
"model".id NOT IN (
SELECT "model_id"
FROM "model_tag_rel"
WHERE "model_id" IS NOT NULL
)
PostgreSQL does not handle well this "NOT IN" expression when the
relation table is large, and uses some very inefficient query plan in
that case. The inefficient query plan is possibly related to the
special handling of NULL values, by the way. This commit changes the
above expression to a "NOT EXISTS" expression (as below), which is
executed with a much more efficient query plan, even with large tables.
NOT EXISTS (
SELECT 1
FROM "model_tag_rel"
WHERE "model_tag_rel"."model_id" = "model".id
)
This change was motivated by a use-case with 2.7M account moves, 11M
account move lines and a many2many relation table with 2.3M lines
(`account_move_line_account_tax_rel`). The query was timing out (15
minutes), and it now takes 15 seconds.
We have replaced all the conditions on many2many fields to use the
relational operators EXISTS and NOT EXISTS.
A test has been added to reflect a case where the many2many table
contains NULL values, like the one for channel_partner in regards to
partner_id and guest_id.
task-2753782
X-original-commit: 334b2aa2aa437d2ed86130f2ed426025f8fe4b86
Part-of: odoo/odoo#87285
Co-authored-by: Didier Debondt <did@odoo.com>
Prior this commit, the `ChatWindowHiddenMenu` had a fixed width and the
`windowCounter` was truncated when the number was higher than 9.
Also, when the `unreadCounter` was displayed, it was partially hidden by
the chat windows.
After this commit, this element uses a fluid width and is in front of
the chat windows to correctly display the `unreadCounter` badge.
task-2781992
closesodoo/odoo#86244
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
PURPOSE
Cleanup and improve composer-related tests. As composer will soon be improved
better ensure we don't break flows.
SPECIFCIATIONS
Cleanup existing tests: rename, make it use tools, reoder them.
Add some tests about composer in order to better spot changes and differences
as well as to help debugging mail composer code update. Notably add tests
with Form tool, add tests for reply-to computation, auto-delete, mail server.
Performance tests about composer are added, notably using the Form tool. This
helps determining differences between creating / manipulating a composer in
code and in UI. Indeed notably onchange and some side effects may lead to
different query counters, which is the case as highlighted here. Tests
involving attachments are also added to see their impact on posting process.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
mail_* = mail, test_mail, test_mail_full, test_mass_mailing
PURPOSE
Improve tooling of mail tests. Use SMTP mockup class available in base tests
in mail tests to have a better and simplified mock tool when dealing with
mail tests. Remove old fashioned code.
SPECIFICATIONS
Include ``MockSmtplibCase`` directly into ``MockEmail`` so that we re-use
existing components for mocking outgoing emails. Also make parameters for
gateway coherent between those two classes (use same test values).
Remove 'sim_error' weird parameter of Mail ``mock_mail_gateway`` and use
standard mock 'side_effect' instead in some specific tests, notably on
SMTP.connect() mock.
Add some assert / tools method and improve existing tools, used for creating
or improving test data. This will be used in future commits when adding new
tests.
Add outgoing mail servers data in mail tests, allowing to make tests closer
to real life use cases.
Remove unnecessary calls to ``_init_mail_gateway`` as it is automatically
done in ``MailCommon.setUpClass()``.
Try to consolidate starting test data, notably with countries, phone numbers
or email in mind to be sure test mail are deterministic.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
Activity-level feedback method accepts attachment_ids but not its mixin-level
counterpart. This commit fixes that by adding the parameter. The activity-level
action_feedback_schedule_next method now also accepts attachments in addition
to the feedback, making the API coherent through all entry points.
At activity level ``action_done`` now goes through ``action_feedback``. This
means it now has two main methods
* ``action_feedback``;
* ``action_feedback_schedule_next``;
All methods finally end up calling ``_action_done`` and correctly propagate
feedback and attachments. We have a bit less entry points with possible API
changes.
Test mail models are updated to be able to use this small addition.
Task-2710804 (Mail: Clean MailThread API)
Part-of: odoo/odoo#86393
Now that message list view exists, it should be used whenever possible, in
preparation of future commits.
Part of task-2801089
closesodoo/odoo#87113
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, if the user has read only access to a record:
- User could see 'Add Followers' button, which raised AccessError
- User could see edit and remove icons but performing these actions
for followers other than one related to logged in user, it also
raised AccessError.
With this commit, we are restricting it based on the user rights, if
the user has read only access to a record:
- 'Add Followers', subtype edition(pencil icon) and follwer removal
buttons will be visible only for the follower related to logged in
user, not for others. This way we can avoid the unexpected
AccessErrors.
Note that if user is having write access for the record, nothing
changes.
task-id-2447776
closesodoo/odoo#70575
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit:
Attachment viewer download and print buttons not working for guests.
After this commit:
Attachment viewer download and print buttons will work for guests.
Task-2664842
closesodoo/odoo#87025
X-original-commit: 191a4b21a446d17a5090481b16f3de56a57f611e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Thread/hasComposerThreadTyping is always set to boolean, so never `undefined`.
Task-2793280
closesodoo/odoo#86965
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>