Commit Graph
695 Commits
Author SHA1 Message Date
Christophe Simonis 2bc6ea1b37 [MERGE] forward port branch 11.0 up to 02ee3fd88e 2018-05-23 19:33:40 +02:00
SEINLET Nicolas 0b6182de38 [FIX] mail: speed up search on followers (#24737)
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.
2018-05-18 15:05:22 +02:00
Christophe Simonis 1655202924 [MERGE] forward port branch 11.0 up to 59a8a1cd8e 2018-05-17 13:19:49 +02:00
Thibault Delavallée 7313ce7d3c [FIX] mail: correctly fetch needaction partner ids in chatter
Why y push too fast.
2018-05-17 12:34:46 +02:00
Thibault Delavallée 0897195f91 [FIX] mail: improve implementation of message format fix
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.
2018-05-17 12:27:38 +02:00
Nicolas Martinelli 77aa313b14 [FIX] mail: XHTML
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
2018-05-17 09:27:38 +02:00
Xavier Dollé 19fb650863 [FIX] mail: correctly filter needaction on unread notifications in message_format
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.
2018-05-16 16:00:43 +02:00
Xavier Dollé 69714fbeee [FIX] mail: correctly filter needaction on unread notifications in message_format
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.
2018-05-16 16:00:06 +02:00
Christophe Simonis e70e5b6cf3 [MERGE] forward port branch 11.0 up to 2787de8c68 2018-05-14 16:46:11 +02:00
len-odoo 6c6c4b89a0 [FIX] mail: parse eml/msg attachments
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
2018-05-09 16:49:34 +02:00
Christophe Simonis ac63dfc8f4 [MERGE] forward port branch 11.0 up to 8dade01e2c 2018-05-04 16:10:50 +02:00
Nicolas Lempereur 2b0d68bc41 [FIX] mail: activity in date tz but counts are not
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
2018-05-05 00:38:35 +13:00
Thibault Delavallée 901658df26 [REM] mail: remove duplicated method
This commit remove duplicated code probably due to a forward-port of a backport
or something like that. Or maybe due to a cosmic beam.

See commits https://github.com/odoo/odoo/commit/14f80bfae66f2c81abb0b8acc0ac558c60ef1d44 and https://github.com/odoo/odoo/commit/36141931bf9a57d01747cb219fdcfdfd7978ab42.

Cheers.
2018-05-04 10:27:58 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Nicolas Martinelli 33b6edfd2f [FIX] mail: onchange activity
- 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
2018-04-26 12:53:30 +02:00
Christophe Simonis 7084a5190c [MERGE] forward port branch 11.0 up to 841f3914cc 2018-04-19 15:04:26 +02:00
Nicolas Martinelli dccef8e41d [FIX] mail: auto-subscribe at user creation
Auto-subscribe to channels at user creation.

opw-1834031
2018-04-19 10:15:10 +02:00
Christophe Simonis fed775bc0c [MERGE] forward port branch 11.0 up to 8c64159b88 2018-04-18 18:20:40 +02:00
Christophe Simonis 2c1c9c21f1 [MERGE] forward port branch saas-15 up to 16ec176620 2018-04-18 14:43:35 +02:00
Christophe Simonis 16ec176620 [MERGE] forward port branch saas-14 up to 67054b6dcb 2018-04-18 13:49:24 +02:00
Christophe Simonis 67054b6dcb [MERGE] forward port branch 10.0 up to 2f037a13ca 2018-04-18 12:14:53 +02:00
len-odoo 1777646d1e [FIX]mail: fix help command in livechat with unlogged user
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
2018-04-17 13:23:50 +02:00
Thibault Delavallée 2d19c4c6b8 [FIX] mail: raise a missing email error instead of crash when logging without email
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 .
2018-04-10 14:45:33 +02:00
Christophe Simonis 860dfb5586 [MERGE] forward port branch 11.0 up to d277adf4d5 2018-04-06 15:36:10 +02:00
Lucas Perais (lpe) 72254129db [FIX] mail_activity: state of activity is TZ dependent
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
2018-04-04 09:49:46 +02:00
Christophe Simonis 4aa5ec3fa5 [MERGE] forward port branch 11.0 up to d67b410dfc 2018-03-07 18:46:38 +01:00
Nicolas Martinelli f7307d64b8 [FIX] mail: activities of archived records
- 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
2018-03-05 11:49:42 +01:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Christophe Simonis 5ad55264e4 [MERGE] forward port branch saas-15 up to b04c8eae6b 2018-03-01 18:02:30 +01:00
Christophe Simonis 9a1d71ce95 [MERGE] forward port branch saas-14 up to d8e45489cd 2018-02-23 18:25:03 +01:00
Christophe Simonis d8e45489cd [MERGE] forward port branch 10.0 up to ab60d773eb 2018-02-23 18:24:26 +01:00
Monica Diaz Pena 088d00f2a7 [FIX] mail: Don't duplicate uuid of mail channels.
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
2018-02-23 08:42:43 +01:00
Alexandre Kühn d56d96dc03 [FIX] *: no concatenation of static and dynamic nocontent helper
* 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.
2018-02-22 16:53:52 +01:00
Christophe Simonis 9a84ba5533 [MERGE] forward port branch saas-11.1 up to e750bb6e11 2018-02-22 10:39:15 +01:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Christophe Simonis dbb713c2f8 [MERGE] forward port branch saas-16 up to 49f8548557 2018-02-21 19:17:01 +01:00
Christophe Simonis 49f8548557 [MERGE] forward port branch saas-15 up to 085ff2f9c4 2018-02-21 18:36:36 +01:00
Christophe Simonis 085ff2f9c4 [MERGE] forward port branch saas-14 up to 8c692aac88 2018-02-21 18:09:17 +01:00
Nicolas Martinelli 1460ed08c9 [FIX] mail: tracking of custom field
- 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
2018-02-21 13:27:02 +01:00
Christophe Simonis eebc7b6e32 [MERGE] forward port branch 10.0 up to 1512618d3e 2018-02-21 12:42:46 +01:00
Thibault Delavallée 5140e19092 [FIX] mail: correctly propagate parameters when re-calling message_post
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.
2018-02-20 17:45:43 +01:00
Thibault Delavallée b4cf1a620c [FIX] mail: correctly give tracking values to notification template
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.
2018-02-20 17:44:57 +01:00
Martin Trigaux 50ccc1e3dd [FIX] mail: know who added somebody to the channel
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
2018-02-20 15:48:48 +01:00
Christophe Simonis ac7abc9879 [MERGE] forward port branch saas-16 up to 7e42a21ee2 2018-02-15 19:40:21 +01:00
Christophe Simonis 7e42a21ee2 [MERGE] forward port branch saas-15 up to d952e3678b 2018-02-15 19:36:09 +01:00
Christophe Simonis d952e3678b [MERGE] forward port branch saas-14 up to 1677d618f0 2018-02-15 19:32:28 +01:00
Christophe Simonis c5899612ef [MERGE] forward port branch 10.0 up to 251b2fdc54 2018-02-15 18:43:15 +01:00
Christophe Simonis 251b2fdc54 [MERGE] forward port branch 9.0 up to 840c3be7b5 2018-02-15 12:56:01 +01:00
Olivier Dony f4bc3acdd5 [FIX] mail: correct errors in b64 images handling
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
2018-02-15 11:12:28 +01:00
Olivier Dony 962af4b780 [FIX] mail: make List-Id header RFC2919 compliant
Fixes the header initially introduced in
f62f58174b

See also https://tools.ietf.org/html/rfc2919#section-3

Fixes #18408
2018-02-14 19:15:02 +01:00