Commit Graph
1467 Commits
Author SHA1 Message Date
tsm-odoo 9e4a8dc43f [IMP] mail, *: split mock server by model/controller
*: bus, calendar, hr_holidays, im_livechat, note, rating, snailmail,
website_livechat.

The mail mock server is getting bigger and bigger. As a consequence,
navigating/keeping it up to date is quiet inconvenient.

This commit solves this issue by splitting it by model/controller.

closes odoo/odoo#98374

Related: odoo/enterprise#32314
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-06 19:03:49 +02:00
Louis Wicket (wil) 8bd03d3984 [IMP] mail, *: move code from components to models (ThreadIcon)
Task-3002515.

* = hr_holidays, im_livechat

closes odoo/odoo#101774

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-06 14:56:44 +02:00
Didier (did) 8554c9d583 [FIX] im_livechat: move checkbox "only if no operator"
task-3006024

closes odoo/odoo#102158

X-original-commit: 0e314674d4157e5f10a313ec70008ed443ce8366
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-05 00:08:57 +02:00
Sébastien Theys cb8583c16e [FIX] im_livechat: prevent crash with avatar of invalid operator
closes odoo/odoo#101948

X-original-commit: f6a01f9d69bd2115ad7e7c0dbb3ffb041fc9e67e
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:19:08 +02:00
Louis Wicket (wil) d562840f69 [IMP] mail, *: refactor patch API to look like model definitions
Model patches are now defined using the `registerPatch` function. This
function takes an object as argument which keys match those of a model
definition.

Benefits:
+ More consistent shape between model definitions and patch definitions
+ No need to import one function to each type of patch
+ No need to repeat the model name for each type of patch
+ No need to import the original definition

Task-2998282.

* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
    website_livechat, website_slides

closes odoo/odoo#101827

X-original-commit: 7d23491b44b7372209057ea2abc565a95710b316
Related: odoo/enterprise#32136
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:18:49 +02:00
Jeremy KerstenandBenoit Socias 878351d840 [IMP] base, web, website, *: differentiate essential & optional cookies
*: im_livechat, survey, utm, website_crm_iap_reveal, website_forum,
   website_livechat, website_sale, website_sale_comparison

Before this commit all cookies were considered essential.

This commit makes some of them optional. It also makes it possible for
the website visitor to only accept the essential cookies.

task-2800976

X-original-commit: 9a8a9463289a7446e9be0ef62ff895feb37a4de4
Part-of: odoo/odoo#101845
Co-authored-by: Benoit Socias <bso@odoo.com>
2022-10-03 10:56:58 +02:00
Brieuc-brd 47de574e1b [FIX] im_livechat: adapt window height
Since PR[1] the size of the chatWindow has been increased in the
backend.
But on the frontend, this window has kept the old height.

This commit fixes this issue.

PR[1] : https://github.com/odoo/odoo/pull/92872

closes odoo/odoo#101508

X-original-commit: bd9849361d2a72ddd9a036edcf31fab21316d909
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-29 09:09:06 +02:00
Antoine Guenet 9dbbaa7a09 [IMP] mail, mass_mailing, im_livechat: port emoji fields to OWL
This ports the `text_emojis` and `char_emojis` fields to OWL.

X-original-commit: 65b3e551aee0ea451a7f48c6778ce78931bff3e8
Part-of: odoo/odoo#101350
2022-09-28 09:38:55 +02:00
Louis Wicket (wil) 3d0fdc59a0 [IMP] mail, im_livechat: remove conditions from sort
This commit makes all sorts unconditional, which would allow us to get
rid of the functions that wrap the sorting rules and use arrays directly
instead.

This will allow us to lighten the syntax and to perform some
optimizations in subsequent PRs.

Task-2992581.

closes odoo/odoo#100895

X-original-commit: 4d15ca0f6883fb089e8d7514c4e639b86cedbd45
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-23 11:22:14 +02:00
Aurélien Warnon f5456d9a18 [IMP] im_livechat: port the chatbot form to OWL
This commit ports the custom implementation of the view form for the chatbot
scripts to the new OWL framework.

The goal is the same as the base customization, which is mainly to correctly
assign a sequence to every step and save the form in-between every new steps.

This is necessary to allow the end-user to easily configure its script, since
steps can depend on each other.

More details in https://github.com/odoo/odoo/pull/84000

In addition, we slightly adapt the CRM bridge to enable no_open for the sales
team field.
This avoids issues when the user tries to open modals on top of modals.

Task-2981969

closes odoo/odoo#100940

X-original-commit: 68d5da02642d22551603e4c6b5583755b2f4fc2d
Related: odoo/enterprise#31688
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-09-23 08:26:07 +02:00
Pierre Paridans 586ed792fb [REF] web,*: group Bootstrap config/customization files
- Take them out of `legacy` codebase.
- Group them in a generic `static/src/scss` folder, as those files are
  used in webclient but also in public livechat, portal...

X-original-commit: ca2e4fea92b5a26078a412072275a969508358c7
Part-of: odoo/odoo#100759
2022-09-23 01:39:34 +02:00
Joseph Caburnay 7971b4ed4d [REF] im_livechat: im_livechat_channel_form_view wowl
No need for the view. Replace with simple button widget.

closes odoo/odoo#100808

X-original-commit: 3a02a438c2228e78c93e363351297e0c3548e865
Signed-off-by: Antony Lesuisse <al@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-09-22 15:50:24 +02:00
Alexandre Kühn 5b59a07729 [IMP] mail, *: introduce public livechat bundle
*: hr, im_livechat, snailmail, website_livechat

This commit introduces the public livechat bundle, which
contains the models that are specifically used in public livechat.

Doing so reduces the amount of model and data in frontend and
external lib, which makes the page load faster.

Task-2990182
Task-2990191

closes odoo/odoo#100768

Related: odoo/enterprise#31608
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-22 15:50:12 +02:00
Alexandre Kühn 0ae4fadf08 [IMP] mail, *: convert all compute/sort method into inline field function
Task-2985304

closes odoo/odoo#100765

X-original-commit: e267d52cc4380c3acf7d2f9c9abf1acb59a598c1
Related: odoo/enterprise#31606
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-22 01:54:20 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
Louis Wicket (wil) b9b0d9c462 [IMP] mail, *: inverse of identifying is automatically causal
* = 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.

closes odoo/odoo#100119

Related: odoo/enterprise#31290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-14 21:22:15 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Gorash ed2b117f5b [IMP] web: Added log information to help fix errors from services.
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
2022-09-14 20:25:01 +02:00
Zelong Lin d57c64f95b [IMP] mail, *: remove 'public' field in channel
*: 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

closes odoo/odoo#90415

Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 10:57:59 +02:00
Alexandre Kühn 4aa4c8e87f [FIX] im_livechat: do not cut header content in external lib livechat
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

closes odoo/odoo#99542

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-09-05 18:36:01 +02:00
Louis Wicket (wil) ff49527fb5 [IMP] mail, *: convert ThreadPreview to use Channel instead of Thread
* = im_livechat, rating, test_mail_full

Part of task-2948676.

closes odoo/odoo#99342

Related: odoo/enterprise#30921
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-05 16:53:52 +02:00
Louis Wicket (wil) 9beb2b13d3 [MOV] mail, *: rename ThreadPreviewView files to ChannelPreviewView
Part of task-2948676.
* = im_livechat, rating, test_mail_full

Part-of: odoo/odoo#99342
2022-09-05 16:53:52 +02:00
Didier (did) 7ceb079455 [IMP] mail: implement link preview with OpenGraph Protocol
OpenGraph Protocol https://ogp.me/ allow us to get some data from the link that
are shared in message.

task-2365881

closes odoo/odoo#82641

Related: odoo/enterprise#30867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-05 14:49:30 +02:00
Louis Wicket (wil) 10950d549d [IMP] mail: add support for inline definition of sort and compute
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.

closes odoo/odoo#99424

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-02 19:14:04 +02:00
Sébastien Theys 545d23888b [IMP] mail, im_livechat, *: add typing for guest and clean code
* = 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

closes odoo/odoo#98923

Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 20:21:58 +02:00
Alexandre Kühn 449d76dbca [FIX] im_livechat: do not willStart when livechat unavailable
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

closes odoo/odoo#99385

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-01 15:33:25 +02:00
Louis Wicket (wil) 6a6e737f61 [IMP] mail, *: move channel concerns in Thread from Thread to Channel
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.

closes odoo/odoo#98149

Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 20:22:14 +02:00
Rahul Prajapati fd9db95d61 [IMP] im_livechat: unpin read livechat sessions after one day
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
2022-08-30 20:22:00 +02:00
Alexandre Kühn 11c8e94a14 [FIX] im_livechat: restore fold feature in public livechat
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

closes odoo/odoo#99024

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-08-30 08:18:40 +02:00
Alexandre Kühn aecdc50278 [IMP] im_livechat, *: Refactor JS Public Livechat (step 16)
*: 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

closes odoo/odoo#99137

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 02:51:08 +02:00
Lưu Quang Huy 4d2c346071 [I18N] im_livechat: Add missing translation part
closes odoo/odoo#98842

X-original-commit: 3b56ebff5e0afdfa10a1660def4d1a51a2487bb6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-29 22:43:28 +02:00
Alexandre Kühn b8f0ccf6ed [FIX] im_livechat: properly display operator avatar in posted message
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`.

closes odoo/odoo#99022

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-27 05:25:53 +02:00
Alexandre Kühn 0d06e5aae8 [FIX] im_livechat: make bubble background behind message content
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.

closes odoo/odoo#99020

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-27 05:25:50 +02:00
Alexandre Kühn c0532b6aec [IMP] im_livechat, *: Refactor JS Public Livechat (step 15)
*: 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

closes odoo/odoo#98987

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-27 03:33:58 +02:00
Alexandre Kühn 14f2a03c75 [FIX] im_livechat: guard Chatbot/data (i.e. chatbot being available)
Task-2962136

closes odoo/odoo#98848

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:20 +02:00
Alexandre Kühn f5304e4c80 [FIX] im_livechat: remove imperative update of Chatbot/state
Task-2961956

closes odoo/odoo#98817

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 01:55:39 +02:00
std-odooandThibault Delavallée eb75a77646 [REF] mail: update the message content in the mail thread model
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>
2022-08-25 19:57:16 +02:00
luvi 67b41d47e6 [FIX] im_livechat: add w-auto on layout colors fields
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.

closes odoo/odoo#98871

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:43 +02:00
Thibault Delavallée d13d251a2f [MOV] various: move and split mail data
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
2022-08-25 10:31:56 +02:00
Thibault Delavallée 0419de7ff2 [MOV] various: move / rename rating files
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
2022-08-25 10:31:56 +02:00
Sébastien Theys f8c2689f3b [FIX] im_livechat: avoid writing on computed field correspondent
closes odoo/odoo#98836

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-25 04:21:24 +02:00
Alexandre Kühn 34c88157a6 [IMP] im_livechat, *: Refactor JS Public Livechat (step 14)
*: 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

closes odoo/odoo#98798

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-25 04:21:01 +02:00
luvi ca3f1e2d56 [FIX] im_livechat: fix style of livechat_colors
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
2022-08-24 19:53:58 +02:00
Alexandre Kühn 561409683d [FIX] im_livechat: properly guard inside debounced scroll
Task-2960982

closes odoo/odoo#98721

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-24 18:39:03 +02:00
Alexandre Kühn df6a4a7e10 [FIX] im_livechat: properly call chatbotRestoreSession
Task-2960978

closes odoo/odoo#98720

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-24 18:38:59 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: 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
2022-08-23 17:55:10 +02:00
tsm-odoo c218c09119 [IMP] mail, im_livechat: remove thread local id usage from tests
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

closes odoo/odoo#98588

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-23 15:05:36 +02:00
Zelong Lin 02fc44ab55 [IMP] mail: compact message action list
Introduce messag_action and message_action_view

task-2869932

closes odoo/odoo#97738

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-22 19:12:39 +02:00
Alexandre Kühn 4b275309b4 [IMP] im_livechat: introduce LivechatButtonView/isLastMessageFromCustomer
Task-2940469

closes odoo/odoo#97256

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-19 20:24:46 +02:00
Sébastien Theys 34d775e873 [IMP] mail, *: remove explicit usage of insert-and-replace
* = 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

closes odoo/odoo#98404

Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-19 11:53:05 +02:00