Rev. on this commit: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
A consequence of the above commit is that @ mention were broken:
the dropup menu with partner propositions was not displaying when
the user typed the first characters to mention a user (e.g. by typing
"[at]demo" in order to show the proposed mention "[at]Demo User" in a dropup
menu).
This commit fixes the issue by reverting the logic of how mentions are provided
by the chat_manager, while removing some dead code.
note: [at] = @
Before this commit, if we wanted to add channels on rpc initMessaging,
we had to mock this rpc completely.
Now, with this commit, we can use data 'initMessaging', whose keys
can overwrite the default mocked initMessaging.
For instance, if this.data.initMessaging has the key 'channel_slots',
then the mocked initMessaging rpc will return a new state for the
existing channels to the chat_manager.
This is needed in order to reduce the size of tests than need some custom
initMessaging state, such as any test that needs at least one non-static
channel (i.e. neither channel_inbox nor channel_starred).
Before this commit, phantomjs was crashing when some code manipulates
window.getSelection (such as the composer input in discuss or in the chatter).
This commit lets us mock window.getSelection in tests that need this function
in order to work properly.
Another benefit of this commit is the possibility to simulate the state of
window.getSelection in our tests, which enables tests on the composer that
were not possible before (e.g. making sure that mentions and emojis are
correctly rendered in the input, after the user clicked on them in the dropup
menu or the bottom bar.
This commit adds a first test of discuss, which checks that the
essential DOM elements are present when we create a discuss widget.
In particular, there should be a sidebar that contains links to
channel_inbox and channel_starred.
In order to test discuss, the service 'chat_manager' has to be ready.
We do not want to explicitly write discuss.call on any test with discuss,
so now the function createDiscuss returns a promise that is resolved with
the discuss widget when the chat_manager is ready.
Discuss has to perform a rpc to fetch messages of its channels.
Some tests do not care of the result of this rpc call, so we mock
it by default (by default, channels have no messages in our tests).
From a recent action manager refactoring (https://github.com/odoo/odoo/commit/32b8cec5361174c92c45a4975d4e02f1fb448aa2),
the attribute 'views' in viewOptions is now structured as follow:
viewOptions: {
action: {
views: [{
viewID: 1,
type: 'list',
}],
}
}
instead of this:
viewOptions: {
action: {
views: [[1, 'list']],
}
}
The pivot view was not updated correctly, so now it should be correct.
When executing an act_window action, the ActionManager has to
determine whether or not the first view of the action is a form
view (typically, when this happens, this is also the only view of
the action, and most of the time, it is displayed in a dialog, i.e.
the action's target is 'new'). This ensures that the control panel
is correctly shown/hidden, that form buttons are correctly rendered
and displayed at the right place, and so on.
Before this rev., it uses the view_mode to do that, but there is no
guarantee that the view_mode is even defined (for instance, actions
returned from python methods don't have to define it), so from now
on, we use the 'views' attribute instead, which must always be set.
Before this rev., a traceback was raised when the user tried to
edit the company data, by clicking on the company logo in the
submenu (community edition only). This was due to code not being
converted after the ActionManager refactoring of 7b6056a0.
Also ensures that the logo is properly reloaded by specifying the
timestamp in the img url as a query string parameter instead of an
hash param, since changing the hash doesn't seem to be enough to
fool the browser's cache anymore.
Use case to reproduce:
- Install sale_stock
- Create a SO
- Cancel it
Traceback
It happens because _log_activity_get_documents need at least
one entry in the dict orig_obj_changes.
* account, board, hr_holidays, mail, sale, website_sale
Small fixes on nocontent onboarding screens.
Initial commit: https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417
Details:
- list: centered;
- pivot/graph: centered + empty folder face;
- Dashboard app with nocontent helper;
- Discuss inbox/starred: centered without neutral/smiling faces;
=> no faces because it's too much with animated
rainbow man when emptying the any of the boxes.
- hr_holidays: fixed onboarding screens;
- (technical) dropped obsolete 'o_view_nocontent_container' style;
- manual reconciliation 'nothing to reconcile': centered + inside form sheet;
=> renamed account's o_view_nocontent to o_view_noreconciliation,
so that it doesn't use the style of views.less.
- kanban: nocontent helper above the columns (if any);
- texts "no order to upsell"/"abandonned cart" paragraph split in two.
Server actions return an action to execute, or false. When they
return false, an 'ir.actions.act_window_close' must be executed,
such that the current dialog closes (if any) and mostly, the
'on_close' handler is executed, which ensures for example that the
current view is reloaded.
The case where server actions return false has been broken by rev.
32b8cec53. It produced tracebacks in several models, when clicking
on some actions in the 'Action' dropdown. For instance, in lunch,
go to Configuration > Products, open one in a form view, and click
on 'Lunch: Archive/Restore products' in the Action dropdown.
Revision of https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498
One of the purposes of the previous commit was to test discuss.
There was an attempt to test im_livechat, but it has been aborted due to the possibility
to use livechat on an external website.
However, some bits remain from this attempt, such as LivechatButton becoming a JS service
provider in order to use those services with the external lib. LivechatButton was not working
for the following reasons:
- ServiceProviderMixin.init was not called (so it couldn't load any service);
- On website, there are two service providers (LivechatButton & websiteRootInstance).
This fix ensures that LivechatButton does not rely on JS services, such as the bus_service.
The emails sending is skipped during the tests.
The mecanism to determine if the server was running tests
was to check if the attribute `testing` was set for the thread.
Unfortunately, this `testing` attribute is removed/set to false after the loading/installation
of the modules is done, and phantomJS tests are ran post-installation,
and therefore the emails that were potentialy sent following an action
performed in a PhantomJS tour were not skipped.
This occurred for instance in the tour `project.tour`,
when the responsible of a task was changed,
the sending of the assignation notification email was not skipped.
In the case the machine on which the tests are ran does
not have an smtp server (or mailcatcher) running on the port 25,
this resulted in a test fail.
- In SaaS-16 we have added a related on the employee's manager as the manager of the leave.
This cause access rights issues when changing the employee's manager.
We do not want to rewrite all the old records, only the new ones should use the new manager.
Since commit a18bd499ac alias_domain was
not updating correctly in the settings.
This commit fixes the issue by updating to code to conform to the new
config_parameter interface.
Previously, some screen in front was casted in Integer, others not.
This commits closes#22443
To improve in master using precision decimal, t-field, ...
But avoid to change in dom tree in stable version
- Create a project and a task
- Add a channel as follow of the project and task
- Set the channel to follow task stage change only
When changing the stage, the tracking is sometimes received in the
channel, sometimes it is not.
In the case of a stage change, the subtype returned for tracking depends
on the stage sequence. If the sequence is `<= 1`, the subtype for task
creation is returned. Therefore, if the channel is not following task
creation, the tracking message might or might not appear, depending on
the which stage is impacted.
We can remove this specific case, since the creation will be handled
when `user_id` is in the `init_values` or when `mail_create_nolog` is in
the context.
opw-802924
closes#22926
Optimize the copy of the cache being made by related fields to compute
themselves. Instead of traversing records data in cache, follow the cache
structure itself and copy everything!
OPW 816125
- Connect as a user with only 'User' rights on projects
- Set a project as favorite (click the star)
The project is not set as favorite.
Since only project managers are allowed to write on projects, the field
`is_favorite` is set as read-only. Therefore, it is filtered out by
`_generateChanges`, and nothing happens.
First step is to set the attribute `force_save` in the view, so the RPC
`write` call is forced. Second step is to compute directly the inverse
thus bypassing access rights.
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
opw-814604
opw-801587
closes#22938
* web_editor, website
This commit fixes a bug with table duplication in mailing template:
- Click on a snippet with two columns
- Duplicate it
-> the snippet is duplicated but the two columns are transformed in two
rows.
This was because there is an implemented behavior for column
duplication: if we duplicate a column which was alone on its row, we
duplicate the row instead. This code should however be triggered when
duplicating the column alone to be working, not the snippet that
contains it.
Note: this required a backport of a33ec972ab
which was fixing a non-critical "bug" for 11.0. This non-critical "bug" is
therefor fixed here too.
opw-807105
When portal user get email with portal url (like using
website_quote), it crashes because user is not logged.
For this case, we don't want to display the url with the
access token, but simply redirect it to messaging page.
The crash was about the "KeyError: 'view_type'" in
record_action dict, coming from website_quote.
opw-814647