* = im_livechat, snailmail
The model manager will now automatically add `isCausal: true` to inverse
of identifying fields. This commit implements the feature and removes
now unnecessary declarations of `isCausal: true` from the code.
Task-2741402.
closesodoo/odoo#100119
Related: odoo/enterprise#31290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
A typo fix is added.
Fix error from loading xml while widget is destroyed. Now that the xml
templates are loaded in the bundle, the error appears more frequently.
Part-of: odoo/odoo#95500
*: im_livechat, website_livechat
Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)
task-2632861
closesodoo/odoo#90415
Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, chat window header in external lib had text
and button, due to chat window header being too narrow.
This commit fixes the issue by increasing the chat window header
height to match the visual in website livechat, which by itself
also fixes the text and button being properly visible.
Also adapt fold behaviour so it works on click anywhere in the
header, excluding buttons and title click.
Task-2973046
closesodoo/odoo#99542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit allows compute and sort functions to be declared within a
field definition instead of providing a string with the name of the
record method to be used to compute/sort the field value.
Example of code with compute inline:
```javascript
registerModel({
fields: {
thread: one('Thread', {
compute() {
return {
id: this.id,
model: 'mail'.thread',
};
},
}),
},
});
```
Example of code WITHOUT:
```javascript
registerModel({
recordMethods: {
_computeThread() {
return {
id: this.id,
model: 'mail.channel',
};
},
},
fields: {
thread: one('Thread, {
compute: '_computeThread',
}),
},
});
```
The aim of these changes is to empower a better separation of concerns,
by allowing to group together in one place the data related to a field.
Note that for technical reason (`Function.prototype.call` not working as
expected with arrow functions), compute/sort functions should not be
arrow functions.
closesodoo/odoo#99424
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = bus, hr_holidays, test_discuss_full
- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly
task-2664853
closesodoo/odoo#98923
Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Follow-up of https://github.com/odoo/odoo/pull/98160
PR above made single app im_livechat tests sometimes fail with
following error:
```
TypeError: LivechatController.livechat_init() missing 1 required positional argument: 'channel_id'
```
This comes from RPC `/im_livechat/init` in frontend, which must
provide `channel_id` but somehow doesn't sometimes.
This only happens with `test_im_livechat_support_page`, sometimes on runbot.
Task-2969488
closesodoo/odoo#99385
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.
The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.
Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem
Part of task-2948676.
closesodoo/odoo#98149
Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose:
Make sure livechat operators are not buried under a huge pile of old sessions.
Specification:
Unpin read livechat sessions, 24 hours after the last message has been read by
the operator.
Task-2446972
Part-of: odoo/odoo#92053
Before this commit, folding chat window in public livechat
was not working.
This is because the title of chat window was 0px of height,
so it was impossible to click on it.
This commit fixes the issue by letting title take as much vertical
area as it is available in the header, so that the header
except buttons is clickable to fold the chat window.
Task-2964331
closesodoo/odoo#99024
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2965839
closesodoo/odoo#99137
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, avatar of operator was not displayed properly.
This is due to src of avatar being wrongly computed: the serverUrl
data is in `PublicLivechatGlobal`, not in `LivechatButtonView`.
Because of this, the src was prefixed with `undefined/` instead
of the server url, hence no displaying the avatar of operator.
This commit fixes issue by getting actual `serverUrl` in correct
model `PublicLivechatGlobal`.
closesodoo/odoo#99022
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, bubble background was on top of message content.
This prevent user interaction on the message.
This commit fixes the issue by properly putting background behind text.
closesodoo/odoo#99020
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2963842
closesodoo/odoo#98987
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose
=======
Move the code which updates the mail message from the message model to mail
thread. Most other thread methods (like `_message_update_content_after_hook`)
are defined at record model level. It makes sense to delegate the update to
documents and not to the message. Message is a low-level technical object
that should not really hold business code.
While modifying this code, an update is done in the update content. We now
also allow to update the body without removing all attachments.
Finally tests are added as this feature was added without really testing
model code.
Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
In commit 0194fa8236144596042a20f182ec3f48ea29b998, we fixed
the appearance of the color list in the livechat channel view.
But w-auto classnames were not added to some fields, which let
the positioning issues only partially fixed.
This commit concludes the fixed introduced in #98755.
closesodoo/odoo#98871
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
Just doing the summer file cleaning. Move rating code into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2961782
closesodoo/odoo#98798
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit fixes the style of the color selectors
in a livechat view. New classnames have been added
to revert to the intended appearance of the field
in the view.
Part-of: odoo/odoo#98755
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.
This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.
Available events are:
- connect : fired upon a successful connection.
- disconnect : fired upon reception of the websocket close event.
The close code and reason are given to the listeners callback.
- reconnect : fired upon a successful re-connection.
- reconnecting : triggered when the worker starts to try reconnecting.
- notification : fired upon the reception of notifications.
Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.
Part-of: odoo/odoo#75510
Using local ids in test is cumbersome: we need to retrieve the mail
record associated with the server record to get it while the thread
model/id are more than enough and available. This PR replaces thread
local id data attribute by thread model/id.
task-2959366
closesodoo/odoo#98588
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
website_livechat
Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.
task-2957295
closesodoo/odoo#98404
Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.
Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat
closesodoo/odoo#98283
Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* im_livechat, mail, snailmail, website_livechat
PURPOSE:
A `replace` command should be default while updating a field.
SPECIFICATION:
- If no command is passed while updating a field, add a `replace` command as
default.
- Remove all the existing occurrences of `replace` command.
Task-2851488
closesodoo/odoo#95885
Related: odoo/enterprise#30494
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = calendar, hr, im_livechat, rating, snailmail, website_livechat
This simplifies definition and overrides and opens up new identification
opportunities.
Part of task-2741982
closesodoo/odoo#98166
Related: odoo/enterprise#30470
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit will simplify the code of Thread by properly splitting all
behaviors exclusive to mail.box threads.
* = test_mail_full
closesodoo/odoo#97996
Related: odoo/enterprise#30402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.
* = im_livechat, test_discuss_full
Part of task-2948676.
closesodoo/odoo#97779
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2943607
closesodoo/odoo#97403
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2942001
closesodoo/odoo#97354
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
fields having a tooltip in the future UI.
4/ some cleanup of existing messages too
The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX
closesodoo/odoo#97279
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2939083
closesodoo/odoo#97219
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.
This PR removes `create` and replaces its uses with `insert` directly.
closesodoo/odoo#97058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>