RATIONALE
Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.
SPECIFICATIONS
Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).
In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.
Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.
Also remove useless values given to post API, notably author_id that is by
default the current users' partner.
Task-2710804 (Mail: Clean MailThread Posting API)
Part-of: odoo/odoo#99482
To Reproduce
============
- add event on calendar
- edit the event and remove the user from participants list and add another one.
- save the record -> traceback
Problem
=======
we try to read `hasReadAccess` from `this.followedThread` that is `null` in this case.
Solution
========
check if `this.followedThread` is `null` or not
opw-3126545
closesodoo/odoo#109721
X-original-commit: f9a23af63bb5fe882f0d42f06ef1406910836115
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Issue: `node.data` is an unescaped text content and used as an escaped
content just after (set `innerHTML`) which remove some of the escaping.
Without the fix, the 2 new first assertions would fail:
- first one with 'https://example.com/?¤cy_id' instead of
'https://example.com/?&currency_id' in the text node
- second one with `&` replaced by & and `>` replaced by >
other assertions ensure that use case before the fix (special char and
URL regex, smileys, ...) still work the same after the fix.
opw-2525028
Fixes#70485closesodoo/odoo#109357
X-original-commit: 4938af5dd8bfb4ea0722e3de8340ff6437329b48
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
Since the refactoring of the activity view, luxon is not in the
rendering context. Resulting in crashing in some activity views
that used luxon in their template.
- Go to Appraisal
- Switch to the activity view
- Create a record in this view -> crash
Now, luxon is in the rendering context.
closesodoo/odoo#109153
Signed-off-by: Luca Vitali <luvi@odoo.com>
Before, in activity view, it was not possible for users to hide
never used columns.
Now it is possible for users to hide and show columns in the
activity view.
task-3039919
Part-of: odoo/odoo#109153
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.
This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.
This also removes "Re:" from default mail subjects.
Task-2833215
closesodoo/odoo#95817
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Steps:
- Install knowledge on a fresh db
- Install and set fr_BE language
- Open knowldge
- Traceback
The traceback occurs because `emoji_registry.js` fails to load `emoji_data.js`
because of some translated string that contains non-escaped characters for JSON
opw-3110823
closesodoo/odoo#109086
X-original-commit: 455b335ae773ae4c8f5197c2a6f517947e6a7009
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, typing an emoji source in composer like
emoticon `:)`, it may not substitute to the corresponding emoji.
This happens because the emoji substitution requires loading
emoji data. It was only loaded when opening the emoji picker.
This commit fixes the issue by lazy loading emoji data when
focusing the composer.
closesodoo/odoo#109035
X-original-commit: 066e8029c0d66974c59bfe9e430affb4bf0604b9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, processing of pinned channels during
init_messaging was slow due to sorting them in sidebar
of discuss.
This commit improves the sort so that we do a binary insertion
on add rather than push + quick-sort.
Before what took 2.2 seconds now takes around 0.6 seconds.
closesodoo/odoo#108839
X-original-commit: dd4c3c0a8e38147065980cf2c431b056a5253255
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Since #107916, the ActivityModel did not include
`["activity_ids", "!=", false]` in its domain, causing incoherence in
some views and resulting in crashes.
To reproduce the issue:
- In the runbot, navigate to Website -> eCommerce -> Product.
- Switch to the activity view.
- Remove the Published filter.
- The view crashes due to an incoherence between the data records
in the `web_search_read` and the `get_activity_data` calls.
This commit resolves the issue by correctly setting the domain.
closesodoo/odoo#108807
Signed-off-by: Luca Vitali <luvi@odoo.com>
*: project, web
This commit converts the Activity view to the current framework shared by
other views. Instead of extending Kanban view/elements, the Activity view
has been implemented by its own.
The project customization of the view has also been converted, as legacy
files have been removed.
Some tests have been adapted since some classnames might differ from the old
implementation, resulting to failing tests. But the overall testing cases
have been conserved.
closesodoo/odoo#107916
Related: odoo/enterprise#35177
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Florent Dardenne <dafl@odoo.com>
PURPOSE:
When the push to talk key is the "space" we show an "empty string",
which is very confusing and not very clear.
SPECIFICATION:
We display `Space` string instead of empty space.
Task-2794733
closesodoo/odoo#108573
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Kanban and form archs aren't owl templates. Kanban archs define
a (historically) qweb template ("kanban-box") which is html + some
directives (e.g. t-esc, t-foreach...) and extra tags (field, widget).
Form view archs are html + some extra tags (e.g. group, notebook,
field, widget...).
With the conversion of those views to owl, a door was left open:
one *could* use owl directives (for instance, t-on-click) in archs.
However, we don't want people to do that, as it would tie the archs
in database with js implementation details, which will then limit
the evolution of the js framework.
This commit adds warning when such forbidden directives are detected.
In master, we'll raise errors.
Part-of: odoo/odoo#108221
Before this commit:
There is no debug icon in Discuss Public Page to show whether debug mode
is on or not.
After this commit:
Added a debug icon which will be visible when debug mode is on.
Task-2664824
closesodoo/odoo#97178
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit:
Emoji data are all in English. Unable to use in other languages.
After this commit:
Emoji names and keywords are translatable for search and display purposes.
Emoji category names are translateable for display.
Task-3043336
closesodoo/odoo#107941
X-original-commit: ee5e0a201fb1980c1745692d366fd8539815773e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In some case, we want that chatter takes the all space
available.
Steps to reproduce:
- Go to Email Marketing
- Click on any record
- Go to the Chat tab
closesodoo/odoo#107928
X-original-commit: cbbbc23800e2a00aab9af45087b5d3f7698823d8
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before [1], the bus was started lazily: either as a consequence of
the addition of a channel to listen to or by manually calling the
`startPolling` method.
Before this commit, the websocket would have been started as soon as
the bus service starts which degrades performances.
This PR fixes the issue by re-introducing the same mechanism as before
that is by starting the websocket either by calling manually the `start`
method of the bus service or automatically when adding a channel.
[1]: odoo#75510
closesodoo/odoo#107878
X-original-commit: 5d7deacf54f37f0938b92a3c45c9f1d1325d1a9f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Before this commit, the rendering context of kanban and form views
was the instance of the KanbanRecord and FormRenderer, respectively.
As a consequence, a lot of implementation details (e.g. "props",
"__owl__", any Class method...) were available. This wasn't what
we want.
The door being left open, people went through, and in 16.0, several
kanban and form archs contain(ed) such use of undesired "features".
With this commit, we restrict the rendering context of those two
views. In kanban views, it contains what has been historically
available (e.g. "record", "widget", "kanban_color"...). In form
views, nothing is available since the only dynamic part in those
archs is the attrs, which aren't evaluated by the rendering engine.
To do that, we use `t-call-context` owl directive. When using this
directive, the rendering context is the given one, + `this`. So the
component instance is still available, but through the `this`
keyword. We can thus use it in our compilers, to make them work as
before. Note that `this` can never be used in an arch directly.
Task 3085357
closesodoo/odoo#106045
Related: odoo/enterprise#34493
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
CONTEXT:
emoji_char_field and emoji_text_field
previously used the emoji_dropdown component
along with some utility functions to display
a very limited number of emojis.
As discuss now has a feature-full emoji picker
we aim to take advantage of it by bootstrapping
the picker from the existing components,
using a new javascript model for the
insert/update logic
AFTER THE CHANGE:
Users should be able to select the same emojis
they can use in the discuss chat in all fields
that previously featured an emoji picker.
Such as the livechat bot responses,
social posts, mailing subjects and
the sms message composer.
RELATED CHANGES:
Some tests are updated to use the pyEnv testing
'framework', as we now need to have access to
the messaging service to test these fields.
emoji_mixin is modified to match any emoji
character. The mixin is consolidated into
a single function is actually called anymore.
The text to emoji dict from emojis.js is removed
as it is no longer relevant where it was used.
The fields that used the emoji_mixin will no longer
trigger onChange on inserting an emoji.
However both the input and keydown event are fired
to allow fields using onchange_on_keydown
to trigger the onchange.
The emoji button was turned into an actual button
replacing the original span used in these fields.
This required a different approach to styling as
buttons inherently behave differently than spans.
The button is now moved using an empty div next
to the input and absolute positioning.
Most of the code used for char and text emoji
fields is consolidated into emojis_field_common.
task-3035021
closesodoo/odoo#104799
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Before this commit, when resizing window so that chatter swap
position, the text content of message disappeared.
This happens because OWL re-render the message view as completely
different DOM elements, while modeling in discuss code kept
identity of the MessageView. As a result, the message text content
was unchanged therefore it was not updated in the DOM, thus staying
blank.
This commit fixes the issue by enforcing setting the message text
content in DOM whenever the value is empty in DOM but the message
has logically some text content.
closesodoo/odoo#106978
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this PR, posting a message containing an attachment with a long
name in the chatter would result in the chatter overflowing the main
window. This is due to the fact that flex items cannot be smaller than
their content.
This PR fixes the issue by adding the `overflow-auto` class to the
chatter container in order to override the default `min-width: auto`
of flex items thus allowing them to be smaller.
closesodoo/odoo#106927
X-original-commit: 73fb78e75b6126586385ea7621b6d71fae715305
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When activity group (e.g. activities for Sale Orders) has future acitivities,
but not today or overdue activities, the group is deleted. This is not what we
want. In v15 it worked opposite way, but in v16 it was changed after js
refactoring. Variable name for `total_count` is confusing. It actually means
today activities + overdue activities [1]
[1] https://github.com/odoo/odoo/blob/1666ee5515996fab8a843b36b4fd93b776172f75/addons/mail/models/res_users.py#L237-L238
opw-3042616
opw-3063110
closesodoo/odoo#106482
X-original-commit: b5aaf7b4ab78af29feab85066f4888d3cded018a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
The logic to set the focus on the emoji search bar was only triggered
the first time any emoji picker was opened.
This makes sure the focus is processed every time a picker is opened.
task - 3035021
closesodoo/odoo#106315
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Previously, we had an option on char/text fields called "onchange_on_keydown",
which allowed to trigger the onchange while the user was typing (instead of
when the field is blurred).
It was notably used when typing a phone number in the sms composer, to warn
the user that the phone number is invalid.
This feature was lost during the port to OWL, this commit restores it.
Task-3033107
closesodoo/odoo#106193
X-original-commit: 54def8969d49d6e5284cd97ab8df75e08043cd4e
Related: odoo/enterprise#34211
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The code does not actually depend on mail features and it is intended to be used
in the base form view of user.
closesodoo/odoo#105415
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when uploading an attachment then delete
then re-upload attachment again, the reupload was unsuccessful.
This happens because it should clear the `<input>` of type `file`,
but the condition was wrong and therefore `<input>` was not cleared,
thus keeping same value as before so input was not detected as
changed. A change on this file input is necessary to detect user
interaction file upload.
This commit fixes trigger for clearing the `<input>` of type file,
so that any file upload is properly detected, including uploading
same attachment.
Task-3060429
closesodoo/odoo#105465
X-original-commit: 97f445ae15663486d0100d7127287f9ec3d1d4cc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Unused catch block arguments are now forbidden even when prefixed with an
underscore: if the argument on the catch block is not needed, the use of the
optional catch binding is enforced.
Part-of: odoo/odoo#105433
This commit fixes missing hover style on the buttons in the composer.
Task-3050035
closesodoo/odoo#105242
X-original-commit: 2c1d09be03ff9d76d2c3e8189ce89f4a37d45859
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Introduce the '@mail/model' module that gathers all the stuff involved
in model definitions. This allows us to reduce the number of imports.
* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
website, website_livechat, website_slides
Task-3056971
Part-of: odoo/odoo#105096
This commit introduces component hook useMessagingContainer,
which allow to lazily use messaging component in template.
This allow simplifing some code in container, and more notably
in child messaging components, as they can now define their
template in models.
Task-3055886
Part-of: odoo/odoo#105099
*: hr_holidays, im_livechat, snailmail, website_livechat
Clean template of discuss component templates, so that they
are more appropriately compact, which makes it easier to
read the layout at a glance.
Task-3055780
Part-of: odoo/odoo#105099
This commit simplifies discuss template by putting record accessors
in the context of template.
*: calendar, hr_holidays, im_livechat, sms, snailmail,
website_livechat
Task-3055022
Part-of: odoo/odoo#105099
o_mail_notification should only be hidden when seen from the chatter.
At the moment, the notification is hidden everywhere in odoo and
after this PR the notification are only hidden in the chatter
opw-2720840
closesodoo/odoo#105075
X-original-commit: abddcf8bd4b0ba3d8d45ed1ba4e26c3e112b8edb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when deleting a message, there was a traceback.
This was caused by `MessageView/onComponentUpdate` wrongly assuming
`MessageView` from a single branching of identifying owner
(`messageListViewItemOwner`), when there is another one
(`deleteMessageConfirmViewOwner`), specific to when a message is
being deleted.
As a result, crash came from programming error of accessor on
undefined relational field.
Task-3055205
closesodoo/odoo#104995
X-original-commit: 1fbc125451c62b444ce49fa11c8216e52e299b64
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This allows to more easily browse and see all existing fields rather than
seeing a lot of details.
closesodoo/odoo#104839
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: snailmail, website_livechat
This commit adds definition of component template
in the models. This allows not defining JS of component
for most view models.
Task-3053061
closesodoo/odoo#104641
Related: odoo/enterprise#33491
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, there was not visual separator between
end of emoji category bar and the rest of emoji picker header.
Task-3045141
closesodoo/odoo#104767
X-original-commit: d4b654c9322fd7c9f5a3bb94fa41d20fc5d8c998
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>