Improve the usability of the employees profile / "My Profile"
TaskID: 2048672
closesodoo/odoo#35587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Follow up of 61de1c263a
- Remove the dangerous **kw from the route in favor of specifying useful args.
- Use the existing method to link attachments to message instead of duplicating
the logic in an incomplete manner.
- Fix an issue where the actual email would not be sent if the message was empty
but an attachment was defined.
- Ensure the send attempt is done immediately instead of after the cr commit.
The goal is to show potential error messages correctly to the user with the
crash manager instead of a generic error page.
This also increases the send timeout and prevents the error in the first
place in most situations.
closesodoo/odoo#35263
Signed-off-by: Christophe Simonis <chs@odoo.com>
PURPOSE
Allow quick message creation by allowing create multi on mail.message.
Also introduce a new helper tool method to log in batch on records.
SPECIFICATIONS
Purpose of this commit is to add a way to log notes in batch on a document.
Those notes are logged without any notification mechanism, allowing to
attach a note in as few queries as possible.
This is implemented by
* allowing create multi on mail.message. Nothing changes in its behavior
except that it is not working on a list of dictionaries;
* adding a ``_message_log_batch`` tool method allowing to post a batch
of notes on records;
* adding a tool method to correctly find author / email_from, to be used
in various message_post / log / notify methods in order to have the
same behavior in all those methods;
Logging in batch will soon be used in SMS when attaching a note to sent
SMS without having extra notifications. This will be used notably when
performing mass SMS without using the standard notification mechanism.
LINKS
Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)
PURPOSE
Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.
SPECIFICATIONS
The number of message bounce is incremented each time the email bounce
on a specific email address. To have a correct information, we should
reset to zero this counter if we receive a mail from this address.
Indeed, if we receive an email from an email address, this email is
active and the message bounce number (if > 0) is not relevant anymore.
Only models inheriting form blacklist are impacted by this improvement
in order to limit a bit side effect.
Also, add a check in autoblacklist rule. No need to check the stats
if message_bounce is < 5.
This commit introduces
* ``_routing_reset_bounce`` routing method managing the bounce reset;
* ``_message_reset_bounce`` model method that resets bounce counter
in blacklist enabled models;
LINKS
Related to task ID : 1893155
Linked to PR #33340
PURPOSE
Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.
SPECIFICATIONS
Purpose
* move bounce information detection in message parsing. It allows to have
this information available in various steps of routing instead of having
to manually re-compute them;
* handle bounce in specific methods allowing easy override;
* improve bounce management, notably when detecting a bounce not linked
to the bounce alias configuration;
* better integration with blacklist mechanism;
Specifications
* compute bounce information in ``_message_parse_extract_bounce``.It parses
bounce information and returns a dictionary allowing to update parsed email
values;
* remove override in mass_mailign that basically does what mail already
does;
* manage bounce in ``_routing_handle_bounce``;
* when detecting a bounce, correctly call the bounce management method on
all models inheriting from blacklist;
* correctly update bounce counter;
* bounced mailing traces and automatic blacklist in mass mailing should
be done in ``_routing_handle_bounce``;
* add some tests;
LINKS
Related to task 1893155
Linked to PR #33340
PURPOSE
Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.
SPECIFICATIONS
Parsing email values: make message_parse effectively prepare all required
values for later processing
* update message_parse to add some more data directly in parsed dictionary
and avoid having to parse value again in later processing and computation.
* notably recipients computation is now done directly in parsing. It
includes email check and reconstruction using tools methods. That way
routing just has to handle those values and not compute part of them;
* from and cc are correctly managed with parsed and cleaned (sanitized)
versions in dictionary;
* remove all code decoding message header and replace them by fetching
the parsed value instead;
* filter parsed values before calling message_post to ensure right values
are given to it instead of having to manage them in message_post. Indeed
caller has to give the right input;
* make parsing sub-methods (extract payload, post process payload) have
a dictionary as input and output to always manage a dictionary of values
through the parsing methods and update their namespace;
Routing: remove deprecated code parts
* remove use of email_references regex. Indeed emails are routed using their
messageId and not the regex anymore since several versions [1];
* clean some unnecessary variables;
* simplify variable type input, like message_parse accepts only valid
email.message instances and to avoid several decode / encode. Tests are
updated accordingly;
Update docstrings of those methods.
LINKS
Related to task 1893155
Linked to PR #33340
[1] See df037e2959 and 0028c42136
PURPOSE
Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.
SPECIFICATIONS
Purpose: clean mail gateway code by cleaning message_route_verify
``message_route_verify`` is therefore renamed to ``_routing_check_route`` as
there are already some methods prefixed by routing, related to email routing.
This method is also made private as it has no real use for external world.
Parameters of this method are also cleaned. Various cleanings and code
improvements made some parameters not necessary anymore :
* create_fallback: was always True;
* update_author: was always True;
* drop alias: no real use as aliases are used to compute the route and its
access, dropping it at that point has no effect on code;
* assert_model: renamed to raise_exception to be more coherent with the
same kind of parameter used in Odoo;
LINKS
Related to task 1893155
Linked to PR #33340
PURPOSE
Add some improvements in mail gateway: remove private discussion, improve
bounce management, allow resetting bounce counters, improve automatic set or
reset of blacklists and ease mass mailing inheritance.
SPECIFICATIONS
Private discussion support in mail gateway means having incoming messages
not linked to a document. It means having a void model and res_id on related
messages.
Old private conversations in Odoo were implemented using messages not linked
to any document [1]. It was possible to send an email to some people through
the UX and they were able to answer it. Messages were not attached to any
document and model. There were some limitations to this feature, notably it was
limited to replies (no beginning of private discussion through mail gateway).
One way of doing it was through the use of res.users aliases [2]. There was
also a vaguely twitter-lite use of chatter on HR employee profiles linked
to users aliases, then removed with an explicit support of private
discussions [3].
It is not supported anymore since discussion between users is now done using
chat. Aliases on users have since been removed [4]. Contacting partners or
customers can be done on business documents or on channels. Simple email
discussion is not supported in Odoo as it is not the purpose of mailgateway.
This commit removes code related to private discussion in mail gateway and
some specific support in message_post method.
LINKS
Related to task 1893155
Linked to PR #33340
[1] History is a bit messy, see notably fd90140d7b and commits around
[2] User alias addition 052f2ace57
[3] End of employee twitter-like and posting on users = private discussion 89896f32bb
[4] User alias removal 029d1baf35
The new visual indicator for exception activities has been added on all
corresponding kanban and list views.
A new filter "Exception Activities" has also been added in the
corresponding search views.
Task 1889379
closesodoo/odoo#31839
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
The purpose of this task is to add a visual indicator on kanban and list
views when there is an exception activity on a record. To do so, two
fields have been added on the activity mixin that determine if the record
has an exception activity and its corresponding icon.
When there's an exception activity, the next activity icon is different
in the kanban and in the list view, the icon is displayed at the end of
the column with no label.
Prefetching all activity_type_ids in compute will allow to lessen
queries (3 query for this compute) and cache may benefit to other
mail.activity.mixin computed field, like activity_state in kanban view
Task 1889379
All activity filters are now invisible in the corresponding search views.
These filters were only used by activity redirection (when clicking on
the activity item in the systray) so we hide them to reduce the noise
for the user.
"My Activity" filter has also been removed, its corresponding domain is
now directly set in the action where it was used.
Task 2036392
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.
Moreover, this feature was misused. It was:
- left on fields during multiple versions.
- used on reports (SQL views). This would be ok if the feature was
complete, but, as is, it was useless.
- kept unchanged after a second renaming of the field (which can happen
versions later the first rename).
- used, even when the meaning of the field changed. i.e. the field
`archived` has been renamed to the classic `active`, but the value
in the database should be switched.
This gc option should delete more notifications: we only keep notification
not send, and set inbox notification as sent.
closesodoo/odoo#30067
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
mark_all_as_read is using notified_partner_ids to filter
the messages to use. But anyway, the notification will
be filtered on partner right after that.
Since if we have a domain, the message set will be quite small,
(scope of a thread) we search all those messages.
If not, we actually avoid to search on message and go right
to the notifications.
Reading the message_ids will garantee to have the minimal
set of message that where actually passed from unread to read.
Since data should not be in cache at this time and mark_all_as_read
is usually called alone, we prefer to use cache and perform a read
immediatly.
Task-ID 402597
notified_partner_ids, (previously notified_partner_ids) is used to
populate a list of partner to prefetch + return a list of partner_ids.
1. the list of partner_ids is doesn't look to be used, and thus
can be removed. Was introduced in 1d4dbc3440
2. Prefetched list of partners is used to generate customer_email_data.
Since this list is limited to partner email notifications , we can use
a custom search instead.
The proposed implementation is far from perfect but proposes the minimal
changes to remove notified_partner_ids, without (hopefully) negatively
impacting performances.
Task-ID 402597
,*:crm, website_blog
The mail.message needaction_partner_ids meaning changed over time,
and doesn't actually reflect the list of partner in needaction.
More than that the message_format needaction_partner_ids used by js
began to diverged from mail.message field since 19fb650863
To avoid any confusion, renaming it to notified_partner_ids will help
to avoid confusion between python and js meaning, and reflect the actual
content of this field : a list of partner that where notified once on
this message. This field is mainly usefull for testing.
Task-ID 402597
This commit adds a new mailbox in the Discuss app called 'History'.
Messages that have been marked as read are moved to 'History'.
Notifications are required to link history messages to users. So
notifications are now deleted after they are more tha 6 months old.
This means History mailbox keeps less than 6 months old messages.
Note that this feature only works when user notifications are handled
in Odoo. This can be set in the user preferences, under the
"Notification Management" section.
Task-ID 402597
This commit removes the store property of `res_name` from `ir.attachment`
as it doesn't need to be stored and could contain outdated information
if the record name was changed after the computation.
Task: #1943295closesodoo/odoo#34930
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
This check was introduced with d82b897ea1 in 12.0 where `get_base_url` was
not yet a model method.
Since f727cd2645, in saas-12.5, that method is now on model, making the
`hasattr` check useless.
closesodoo/odoo#35057
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The big images are probably never going to be used for the following models:
- pos category
- fleet brand
- livechat channel
- mail channel
- payment acquirer
And if big images are needed some day the model should use image.mixin instead.
PR: #34925
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
what was previously the big size)
+ add new intermediate format:
image_512
PR: #34925
* account, crm, hr, im_livechat, l10n_ch, l10n_it_edi, mail,
mass_mailing, project, stock, base
- `String` -> `string`;
- `defaut` -> `default`;
- `defaults` -> `default`;
- `reandonly` -> `readonly`;
- removed redundant `placeholder` attribute for `Char` field;
- removed redundant `size` attribute for `Float` and `Integer` fields;
- changed to use `Selection` instead of `Char` for a field having a
defined `selection`.
closesodoo/odoo#35356
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Create an activity in a chatter, mark it as done, click inside the
textarea, the popover is automatically closed.
The `click` trigger both opens and closes the popover on click.
opw-2028399
closesodoo/odoo#34982
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Create an invoice for a customer, send him an email from the chatter, in
the mail template set a specific "Reply to" and send the email. The
"Reply-To" template mail header is ignore and the one generated by
`mail_thread._notify_get_reply_to` is used.
See also 1c57d5e and 7b0806b
opw-2041640
closesodoo/odoo#35127
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
When posting a message (here is the livechat use case),
the _postMessage function can call the callback function.
but this parameter is not mandatory.
If the caller of this function doesn't need a callback function
to be called after execution, the _postMessage function was crashing
as callback is not defined.
This commit fix this _postMessage function by checking that
callback is defined before calliing it.
Pre-required for Task ID: 2028059
Fix Task : 2037048
PR #34917
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>