Odoo puts in cache all stored fields of a recordset when you access the
first stored field not already in cache. In this particular case, Odoo
will put in cache all stored fields of 'mail.followers', which is
unnecessary and time consuming, especially on models where user follows
plenty of records.
With thousands of followed records, using a read() when searching on
followers is around 2.5 times faster than using mapped().
Record rules based on followers are speed up the same way.
This is a better implementation of 19fb650863. It seems we did not
see the fix was inside a loop meaning not really optimized when thinking about
Inbox fetching a lot of messages.
In case an email received contains XHTML, `fromstring` fails because of
the following error:
> Unicode strings with encoding declaration are not supported. Please
> use bytes input or XML fragments without declaration.
opw-1832683
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.
This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.
Related to task ID 1841243. This is a manual backport of commit 69714fbeee
done in saas-11.2.
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.
This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.
Related to task ID 1841243.
When parsing an email with some eml or dmg attachment, the parsing would
generate an attachment with empty content.
Since this content is later encoded in base64, it would crash trying to encode
None.
We simply do not process attachments without content.
We add a test to check that parsing mail with some empty attachment doesn't
crash, since the crash implies that the mail gets stuck on server
and is never fully processed by Odoo.
opw 1814014
When creating an activity, the date saved will be the choosen one in the
tought in the client timezone.
But when displaying the counts of activities Late/Today/Future, the date
is tought out as the one in the server timezone.
Thus we would have activity today/future/late not corresponding with the
date in the current timezone.
This is solved in this change and follow what was done in 72254129.
A second change is made so the default "Due date" is today in the
timezone and not today in UTC date.
opw-1837894
closes#24554
- Set a default value for the field 'Activity Type'
- Schedule an activity
The default value doesn't appear.
The default value is taken into account, but the onchange override the
value.
opw-1838066
When an unlogged user creates a livechat, typing the /help command in the
backend would result in the help command sending a traceback.
The function processing the command would assume the existence of a channel
partner name, which is not the case when the user starting the chat is unlogged.
opw:1835484
Currently when posting a message if the author has no email address an user
error is raised. Indeed as posting a message goes through the process of
creating notifications and sending emails an email address is required on
the user.
In saas 11.2 a _message_log shortcut has been added to log notes. This
method should have the same behavior when author has no email. Currently
there is a crash when trying to encode its email. After this commit an
exceptions is raised like classic post.
This commit is related to task ID 1823990 .
Have your user and your system in timezone Sao Paolo
When it is 2200 TZ time, UTC is the day after 0100
Have a activity schedule for today
Before this commit the activity was flagged as overdue.
This was because we compared the date deadline of the activity (no TZ)
to the date.today() in Python
While date do not have TZ legitimately, the moment (and place) you create them matters
Thus, we compared the date of the server (UTC -- day +1) to a date set by the user (TZ -- day -1)
After this commit we make up a date according to the user's tz
And the activity is not overdue, but in state 'today' as it should
OPW 1827920
closes#23969
- Create an activity for a crm lead
- Set the lead as lost
The activity still appears in the list.
A proper fix would be to have an `active` field on `mail.activity`. In
the meantime, simply delete activites when archiving.
opw-1817703
If you duplicate a channel the UUID should not
be copied, otherwise it might introduce security
issues and the method 'channel_minimize' will
fail with an "expected singleton error".
Closes#23102
* crm, hr_expense, mail
The nocontent helper can be generated either statically (in xml)
or dynamically (in python).
Before this commit, the result of some nocontent helpers was simply
the concatenation of the static and dynamic parts.
Due to recent changes (see https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417),
the nocontent helper has changed so that any of the nocontent helper
parts has to define its style for showing the face (e.g. smiling,
neutral, or folder face).
As a consequence of the changes above, the styles of some
nocontent helper screens were duplicated, e.g. two smiling faces
were shown instead of a single one.
With this commit, most dynamically generated nocontent helpers keep
only the dynamic part, so the static part is usually dropped in this
case.
Exception to above rule:
dyn_help = 'You could also add a new [document_name] by sending an email to [email_link]'
The dynamic part is appended right after the static help message, in its dedicated paragraph.
- Create a custom field
Field Type: monetary
Tracking: Always
- Install any module
A crash occurs in `_instanciate_attrs` since `attrs` is `None`.
In some special cases, the instanciation of the attrs of a field is
delayed at the very end of the setup. For example, in case of a Many2one
for which the comodel is not yet loaded.
Therefore the override of the method should take this case into account.
Closes#22922
opw-815185
A new notif_layout parameter has been introduced at 304e6cf90b. However it is
not correctly propagated to sub-calls when redirecting message_post
using context and sub-model.
Notification template has been converted into QWeb at commit 0f301bec25.
A variable renaming has not been correctly propagated, leading to
tracking values not being displayed in notification emails. This
commit fixes that.
When X is adding Y in a discuss channel, the recieved notification was:
- if read in discuss: from Y, "joined the channel" (no information who added him)
- if read in email: from X, "joined the channel" (misleading, think X was the
one joining the channel)
The problem comes from the author_id in the first case and the email_from in the
second, both containing a different value.
Also correct a bad api.multi parameter
Rev 666b594842 introduced an autodetection
mechanism for transforming base64 embedded images inside emails into
attachment with a Content-ID URL.
The patch suffered from several issues:
- the base64 detection regex failed to detect base64 data that is folded
over multiple lines - which happens to be the default in many Python
versions when a binary field is read, or when using the base64 codec
to encode a string.
(Those cases where left untouched and the image was therefore missing)
- there was a logic error in the code when the same image was present
multiple times, leading to an exception (`name` variable was
referenced before being assigned)
This patch addresses both issues.
Fixes OPW-815073