This commit adds the discuss message features to the livechat
threads:
- Edition/deletion of messages
- Reactions
- Replies
It also improves the history view present in the channel form view
by showing replies.
task-2742676
closesodoo/odoo#133456
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, emoji and gif pickers were handled as 2 different
pickers. They had dedicated buttons. This made composer quite
bloated, especially in chat windows were size is narrow.
Also the pickers were always displayed as popover, which is not the
best way to show content in mobile.
This commit improves those pickers in discuss so that only a single
button is present (emoji button). Clicking on this button shows a
picker that groups the emoji and gif picker, both of which can be
selected in the header of the grouped picker.
In mobile, instead of showing a popover, it now shows the grouped
picker below the composer. This makes it show where the soft keyboard
is present in mobile, making it easier to input emojis or gifs on
those devices.
This commit also added slight style changes to both pickers. Notably,
the search bar has an improved style that makes it look good when
next to the composer text input, especially in mobile layout.
task-3015707
closesodoo/odoo#123671
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when opening a record with some attachments
and attachment box is open, switching to a record without any
attachment shows the attachment box open.
This is a problem because the attachment box is designed to only
be open when there are some attachments. The toggler for showing
attachment box is instead an "upload file" button when the record
has no attachment. This means that the open attachment box in those
records without any attachment cannot be toggled off.
This commit fixes the issue by automatically closing attachment box
when the record has no attachments.
Task-3493374
closesodoo/odoo#134771
X-original-commit: ab678ea7618ca1aee5a6ab31b2de59c87fcce32c
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when opening emoji picker and scrolling down
then making search, the scroll position was not reset to top.
This gave the impression that the search was incorrect, because
the most likely desired emoji is at the very top but was not visible
when searching in this condition.
This commit fixes the issue by enforcing scrolling top in emoji
picker content when the search term is updated.
Task-3493611
closesodoo/odoo#134675
X-original-commit: 7999ae51c51e24eea15edb8f08b2e35db4a774ad
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In DM chat, the im status turns into typing icon so it was not
a problem. In group chat and channel, however, there was no way
to see typing members in chat window.
This commit adds explicit small text above composer in chat window
to list typing members of conversation.
Task-3474778
closesodoo/odoo#133757
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The goal of this PR is to improve the readability of expense receipts on
hr_expense and hr_expense_sheet.
This PR do the following:
- Add the expense name next to the filename
- Vertically center the receipt on both model (was previously done in hr_expense
but not for the sheet)
- Make sure the title doesn't get hidden by the image (was previously done in
hr_expense but not for the sheet)
Also, to achieve the first point we had to modify the attachment so that we can
retrieve easily the information of which line the attachment is attached.
closesodoo/odoo#130181
Task: 3443067
Signed-off-by: William André (wan) <wan@odoo.com>
Before this PR, it was not possible to scroll a chat window using page down/page
up, home or end keys.
This is because the thread component that is scrollable cannot became an activeElement.
This PR fix this by adding a tabindex="-1" on the scrollable element.
Task-3468978
closesodoo/odoo#134657
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this commit, quick search in discuss sidebar (shown when
more than 20 conversations) was case-sensitive. For example,
when a channel was named "R&D" and user types "r", the channel
was not found.
This commit fixes the issue by making search case-insensitive.
Task-3485254
opw-3445747
closesodoo/odoo#134603
X-original-commit: 02e5af467b6058ea0933255c8f0c4e8dab17f31d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
'unmounting' key was not passed in when cleaning up the voice recorder
for an unmount.
In whatsapp this made the composer difficult to use as the voice
recoder is unmounted each time a message is sent.
The missing key made it impossible to send multiple messages as the
composer would be in the 'recording message' state, disabling the send
button.
Task-2377154
Part-of: odoo/odoo#134377
Prepare 'discuss.channel' model as well as discuss code to include 'whatsapp'
channels and WhatsApp flow inclusion. Those channels are specifically used
in whatsapp-based flows and have some specific behavior, hence using a
specific channel_type for them.
Also add a setting in 'mail' to install 'whatsapp' module.
Task-2377154 (Add WhatsApp Support)
Part-of: odoo/odoo#134377
Co-authored-by: Akshat Trivedi <aktr@odoo.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Co-authored-by: Gitashri Mantha <gman@odoo.com>
Co-authored-by: Jigar Vaghela <jva@odoo.com>
Co-authored-by: Kashyap Patel <kasp@odoo.com>
Co-authored-by: Khushi Vakil <khva@odoo.com>
Co-authored-by: Nishant Jain <niai@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
Co-authored-by: Priyanshi patel <prpa@odoo.com>
Co-authored-by: Rahul Prajapati <rapr@odoo.com>
Co-authored-by: Renaud Thiry <reth@odoo.com>
Co-authored-by: Shreya Patel <shpa@odoo.com>
Co-authored-by: Stéphane Debauche <std@odoo.com>
Co-authored-by: Zeel Patel <zepa@odoo.com>
In this commit, the loadXML function has been removed. We use registry with
xml_templates to load XML templates for OWL Apps.
The goal of task is to remove loadXML and getBundle from assets to simplify
the understanding of assets api.
task-3266441
closesodoo/odoo#134520
Related: odoo/enterprise#47001
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this commit, formatters like `formatMonetary` and `formatFloat`
weren't loaded in the assets front-end.
This commit introduces `formatAmount` ( `formatMonetary` calls
`formatAmount` but makes some prior processing to deduce the currency
from the field) and makes `formatAmount` and `formatFloat` accessible
from any front-end application.
Note: The currencies were added in the front-end session info because
they are needed in `formatAmount`.
closesodoo/odoo#133824
Related: odoo/enterprise#46658
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Follow-up of https://github.com/odoo/odoo/pull/130821
`name_get` has been deprecated for `display_name`. In old `name_get`,
when the record had no display_name (`convert(rec._rec_name)` returns
`False`) then the fallback was empty string `""`. This has been
changed with default `_compute_display_name`, to instead show
`<rec._name>,<rec.id>`.
Discuss channel `display_name` was relying on this "" fallback
somehow: even though `rec._rec_name == ""`, `convert("") == False`,
thus fallback "" cancels out to "". The value "" for name is
intentional and necessary in discuss channels for the good working
of some other fallbacks UI, e.g. group chat concats member names.
With the recent changes of `_compute_display_name` default fallback,
it showed `discuss.channel,10` instead of "".
Steps to reproduce:
- Log in as Mitchell Admin
- Open Discuss app
- Click "Start a meeting"
=> expected: shows group chat name "Mitchell Admin"
=> result: shows group chat name "discuss.channel,10"
This commit fixes the issue by removing reliance on `display_name`
for discuss channels: it always uses `name`, thus showing taking into
account `""` as it needs for fallbacks like in group chat when it
has no name.
Task-3493629
closesodoo/odoo#134531
X-original-commit: 5592fc107790c910910c2719ede04a86910dc79f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when a message had many link previews,
deleting all of them required to delete one by one.
This commit improves this aspect by showing a "Delete All"
button in the dialog to delete all link previews at once.
task-3488054
closesodoo/odoo#134301
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
odoo/enterprise#46143
Before this commit, messages of type email were not rendered properly in the chatter. For example, the email may display text with dark color even when in dark theme or the layout of bootstrap elements like btn might not look correct.
These style issues are caused by combining the style in content of the email (e.g. inline styles) with the style of the webclient, giving the impression that the original visual of the email is buggy.
This commit fixes the issue by showing a slightly transformed style of email messages in chatter that is readable and looks nice with the Odoo theme at hand. In particular with dark theme, the background color matches the bubble color and the text is white.
Sometimes the exact visual of the original email is desired. A button "Show Original Email" in the top-right corner of the message bubble allows seeing the visual of email in its original intention.
Task-3437069
Forward-port-of: #133545
Forward-port-of: #131202
Part-of: odoo/odoo#134234
Before this commit, static methods on discuss models like `.get()`
or `.new()` where not properly documented.
The superclass `Record` documents `@returns`, but jsdoc failed to
deduce these static methods return subclass instances. We tried to
find a way to define things once in `Record` and let typedoc deduce
things automatically without overriding in each models just for the
sake of type. However typedoc still sucks in 2023 despite requests
for improvements to support this specific case since 2016, 7 years
ago.
This commit fixes the issue by overriding static method in all discuss
models so that the `@returns` is properly documented.
closesodoo/odoo#134316
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR the link preview formatter was creating an unnecessary complex
object in the message key.
This PR simplify the payload by using a message_id key and remove the
unnecessary object.
closesodoo/odoo#134283
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, recipient list in chatter when using composer
in "Send message" mode where listing emails of all followers, instead
of only subscribers of "Send message" (= `mail.mt_comment`).
This commit solves this issue by loading and showing followers
that are recipients in this list. Because this feature and follower
list lazy-load some data, they need to manage they own list for
the "load-more" aspect. That's why the diff shows some duplicated
code as with `followers` field of JS thread model.
closesodoo/odoo#134225
X-original-commit: ba43502b22f8f00e7a2318b341302b809e7129dc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, message actions were all defined in template
of `Message` component. It's good when there are few actions and
the ordering of actions is always the same, but there are now
many actions and we want to order these actions depending on context.
This commit fixes the issue by introducing a special registry to add
message actions. This registry is quite similar to thread actions:
each item define conditions to be shown, behaviour on click, and
their sequence which can depend on the context where the message is
being viewed.
In addition to this message action registry, this commit also
reorder message actions in inbox as follow:
1. Quick actions:
- Add a Reaction
- Mark as To do
- Mark as Read
2. More menu:
- View reactions
- Reply
- Unfollow
- Edit
- Delete
Task-3458086
closesodoo/odoo#131426
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
As the Activity button (clock icon) is the same kind of action
it make sense to apply the text-muted on the quick assign.
To make the hover clearer we apply a text-dark on hover using the
btn-link + contextual classes function. We apply the same to the
`subtask_list_button` and milestones for consistency.
task-3382159
closesodoo/odoo#134196
X-original-commit: 4b8b6e2155eca66652b4a57dfff27b0e81d62573
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
In some tests it was no longer necessary.
Negative tests will be slightly weaker, but they are so weak already
that is does not change much, they should be done differently anyway.
closesodoo/odoo#134025
Related: odoo/enterprise#46739
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
When ThreadActions has a length of 1 it will display the threadAction
multiple times.
ex. In Mobile View When starting a new conversation with a partner from the
`New Message` button from the systray. It will have only 1 ThreadAction
which is `close`. So, it will be displayed multiple times.
After this commit:
If there is only 1 threadAction then it should not be displayed multiple times
closesodoo/odoo#134228
X-original-commit: 6a229db2db60e4b0bfdfe585f5ca05e2e373905f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR, a crash occured when a link preview was recieved from the bus.
This is because the link preview was pushed twice on the `message.linkPreviews`
array.
task-3491629
closesodoo/odoo#134135
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When sending an email from a multi-company environment, the automatic
email signature is not corresponding to the company from which the email
is sent.
This is because the user context is not properly forwarded, in
particular the `allowed_company_ids` key.
The issue comes from the new rpc service not autmatically adding the
user context to the request, whereas the legacy rpc service did.
opw-3394780
closesodoo/odoo#133596
X-original-commit: 5d6a0257ccd7f0b0f9a05050151ba66f35aeea37
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email
Actual result: crash due to parentMessage
Expected result: no crash
opw-3480185
closesodoo/odoo#134123
X-original-commit: 743a298089620865d95f725cae8b3e5ffc9a822e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.
This commit resolves the warnings: `ignoring action (auto) of last step`
task-3429500
closesodoo/odoo#129239
Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Deletion of record requires removing the record entry
in `records`, and it was cumbersome to make a long expression
each time we want to remove the record from this object.
```js
// before
delete this.store.Model.records[record.localId];
// after
record.delete();
```
closesodoo/odoo#134008
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- automatically add `_store` on the record
- automatically register in `records` and return reactive when
`records` is a obj (array => should keep doing it manually)
Part-of: odoo/odoo#134008
1. Introduce `static id` to all models, to uniquely identify
a record in a model. This allows normalizing discuss store
for all models, which helps as preparation for managing
record deletion. Can also be combined
```js
class Message {
static id = "id";
id;
}
class Thread {
static id = AND("model", "id");
}
```
2. Introduce `Model.get()` to easily get a record of model
from data that can identify the record. This prevent leaking
the way the record are stored in `records`, as now all records
are indexed by localId, and localId is technical detail.
```js
Message.get(messageId);
Thread.get({ model: "discuss.channel", id: 1 });
```
Part-of: odoo/odoo#134008
**Changelog**
**3.4.2 (2023-08-26)**
- Fixes regression from 3.4.1 (moment/luxon#1493)
**3.4.1 (2023-08-23)**
- Fixes for regressions from 3.4.0
(moment/luxon#1482 and moment/luxon#1488)
**3.4.0 (2023-08-08)**
- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs
**3.3.0 (2023-03-03)**
- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset
**3.2.1 (2023-01-04)**
- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions
**3.2.0 (2022-12-29)**
- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
(moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)
**3.1.1 (2022-11-28)**
- Add Settings.twoDigitCutoffYear
**3.1.0 (2022-10-31)**
- Add Duration.rescale
**3.0.4 (2022-09-24)**
- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)
**3.0.2 (2022-08-28)**
- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations
closesodoo/odoo#133599
Related: odoo/enterprise#46556
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email
Actual result: crash
Expected result: no crash
opw-3480185
closesodoo/odoo#133370
X-original-commit: 298be6b3762d24883f5019e094425ab8fbdd95e0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
* = calendar, hr, im_livechat, mrp, project_todo, sms, snailmail,
test_mail
The parameter is too often specified with its default value to be worth
being a positional parameter.
Part-of: odoo/odoo#133717
* = calendar, im_livechat, project_todo, sms, snailmail, test_mail,
website_slides
The choice was made to have "trimmed text" check rather than "contains"
to have more robust tests, at the cost of slightly more effort to write
complete and unique asserts.
There is no direct speed improvement from this one, but it is one step
closer to removing jQuery.
Moreover, it will fix infinite loops in some situations, because jQuery
selectors would write attributes on the body, which would trigger the
mutation observer, which itself will call the selector again.
Part-of: odoo/odoo#133717
This was bothersome to export/import the registry and manually add
the model, by providing the model name and the model class.
```js
// before
modelRegistry.add(Model.name, Model);
// after
Model.register();
```
closesodoo/odoo#133658
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In preparation to improvements in models.
Some implementation techniques will want to `new Model()`
without any side-effects.
Part-of: odoo/odoo#133658
This commit improves the mail `onChange` method by adding
the support for multiple keys. This will make the code shorter
and easier to read.
closesodoo/odoo#133778
Signed-off-by: Didier Debondt (did) <did@odoo.com>
In preparation to clean code of models, e.g. by simplifying model
insertion and reducing side-effects in record insertion.
This commit moves the implementation of the `insert()` in discuss
services to the models, and drop support of the service methods
`insert()`. The only way to insert a model is through the store
entry, e.g. `store.Thread.insert()`.
closesodoo/odoo#133509
Related: odoo/enterprise#46499
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This PR adds a panel to consult all attachments of a discuss channel
easily.
task-3476444
closesodoo/odoo#132784
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
1. When the width of a message is greater than the width
of the chatter, a horizontal scroll bar should be activated
on that message, and not on the whole chatter.
2. margin on the seperator to make it more consistent
task-3478057
closesodoo/odoo#133482
X-original-commit: 56a7278edfc717e9e856feccc7514d99d1bf0b2c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>