<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/mail/models/mail_thread.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[REV] mail: fix a traceback when sending a message in a "email channel"</title>
<updated>2021-05-26T07:36:03+00:00</updated>
<author>
<name>std-odoo</name>
<email>std@odoo.com</email>
</author>
<published>2021-01-26T14:11:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=123dce518a0ea44725c55a0719ea45f6d603ff66'/>
<id>123dce518a0ea44725c55a0719ea45f6d603ff66</id>
<content type='text'>
Bug
===
Since 4da64b3f3c8dff88d8e0e01c65374590cc0bf4f7 , if multiple users of
different companies are in the same channel, and if the type of the
channel is "email", a traceback is raised when sending a message.

Technical
=========
"with_user" drop the SU flag and is not enough to bypass the multi
company ACLs. Moreover, we do not want to send a "channel_seen" bus
notifications and we can mark the message as seen on the JS side
directly.

Changes
=======
So now, the traceback is not raised anymore in that case, and the
message is marked as seen if the receiver has the web client open.

But, if the receiver has not the web client open, when he will login,
the message will not be marked as seen. This can be improved but at the
moment we just want to revert the fix that cause the traceback and fix
the issue in most cases.

Task 2427790

closes odoo/odoo#65185

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug
===
Since 4da64b3f3c8dff88d8e0e01c65374590cc0bf4f7 , if multiple users of
different companies are in the same channel, and if the type of the
channel is "email", a traceback is raised when sending a message.

Technical
=========
"with_user" drop the SU flag and is not enough to bypass the multi
company ACLs. Moreover, we do not want to send a "channel_seen" bus
notifications and we can mark the message as seen on the JS side
directly.

Changes
=======
So now, the traceback is not raised anymore in that case, and the
message is marked as seen if the receiver has the web client open.

But, if the receiver has not the web client open, when he will login,
the message will not be marked as seen. This can be improved but at the
moment we just want to revert the fix that cause the traceback and fix
the issue in most cases.

Task 2427790

closes odoo/odoo#65185

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FW][FIX] sale: correctly redirect customers in "Pay Now" template</title>
<updated>2021-04-23T08:00:43+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2021-04-21T15:08:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1476c0f78281fb90e76db5eac193466b86e75a25'/>
<id>1476c0f78281fb90e76db5eac193466b86e75a25</id>
<content type='text'>
Mail holds a "Pay Now" notification template holding notably customized
links to portal for records like sale orders or invoices. It allow to
give a more personalized button than a plain simple "View document" link.

Currently frontend / backend links are not always correctly computed in this
template. This commit fixes that behavior.

Task ID-2513724
COM PR #69607
ENT PR odoo/enterprise#17849

closes odoo/odoo#69714

X-original-commit: odoo/odoo@a55f125f5420797a9378925da5626e43d002b9b0
Related: odoo/enterprise#17889
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mail holds a "Pay Now" notification template holding notably customized
links to portal for records like sale orders or invoices. It allow to
give a more personalized button than a plain simple "View document" link.

Currently frontend / backend links are not always correctly computed in this
template. This commit fixes that behavior.

Task ID-2513724
COM PR #69607
ENT PR odoo/enterprise#17849

closes odoo/odoo#69714

X-original-commit: odoo/odoo@a55f125f5420797a9378925da5626e43d002b9b0
Related: odoo/enterprise#17889
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: prevent use of private addresses for followers, recipients,...</title>
<updated>2021-03-29T14:31:23+00:00</updated>
<author>
<name>Anh Thao Pham (pta)</name>
<email>pta@odoo.com</email>
</author>
<published>2021-02-11T09:40:00+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=20536e1bbeb641539c0de44364f8376e7cef651b'/>
<id>20536e1bbeb641539c0de44364f8376e7cef651b</id>
<content type='text'>
- Connect with Admin
- Go to Contacts, edit himself by adding a Private Address
- Create an Internal User without "Access to Private Addresses" right (i.e. User X)
- Go to any app implementing chatter (i.e. Sales)
- Create a SO
- Add the created Private Address as follower
- Make sure User X can access the record (i.e. Sales: Administrator)
- Connect with User X and open the SO
An Access Error is raised while trying to fetch data about the followers.

This commit prevents to:
- add a private address as follower of a record
- add a private address as Recipient in full composer
- propose private addresses when adding a mention to a partner

opw-2428936

closes odoo/odoo#65933

Task-id: 2463622
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Connect with Admin
- Go to Contacts, edit himself by adding a Private Address
- Create an Internal User without "Access to Private Addresses" right (i.e. User X)
- Go to any app implementing chatter (i.e. Sales)
- Create a SO
- Add the created Private Address as follower
- Make sure User X can access the record (i.e. Sales: Administrator)
- Connect with User X and open the SO
An Access Error is raised while trying to fetch data about the followers.

This commit prevents to:
- add a private address as follower of a record
- add a private address as Recipient in full composer
- propose private addresses when adding a mention to a partner

opw-2428936

closes odoo/odoo#65933

Task-id: 2463622
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: prepare mail header References to avoid line breaks</title>
<updated>2021-03-18T11:11:22+00:00</updated>
<author>
<name>Veronika Kotovich</name>
<email>veronika.kotovich@gmail.com</email>
</author>
<published>2020-03-14T14:30:51+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=402009b6c5082d949e433b8c8cbadb7012174865'/>
<id>402009b6c5082d949e433b8c8cbadb7012174865</id>
<content type='text'>
When Odoo routes incoming emails it is looking for existing messages in
database using Message Ids which are coming from e-mail header
References.

In Odoo the message id looks pretty long like

    743570479975566.1584086032.522504091262817-openerp-message-notify@ip-172-31-45-160

As it declared in [RFC2822] long header bodies can be "folded" using
CRLF+WSP. And some mail clients do that very thing. They split
References header body which contains Message Ids by "\n ".  The example
of mail client where it can be reproduced is apps.rackspace.com We
created Sales Order in Odoo, sent this quotation to the client email. He
replied with e-mail, and this email can't be matched with any existing
message id and as result it's not attached to the Sales Order.

RFC2882: https://tools.ietf.org/html/rfc2822#section-2.2.3

closes odoo/odoo#68069

X-original-commit: 559f6cf62711ad45557eddec3af7c66616724eb5
Signed-off-by: Julien Castiaux &lt;Julien00859@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When Odoo routes incoming emails it is looking for existing messages in
database using Message Ids which are coming from e-mail header
References.

In Odoo the message id looks pretty long like

    743570479975566.1584086032.522504091262817-openerp-message-notify@ip-172-31-45-160

As it declared in [RFC2822] long header bodies can be "folded" using
CRLF+WSP. And some mail clients do that very thing. They split
References header body which contains Message Ids by "\n ".  The example
of mail client where it can be reproduced is apps.rackspace.com We
created Sales Order in Odoo, sent this quotation to the client email. He
replied with e-mail, and this email can't be matched with any existing
message id and as result it's not attached to the Sales Order.

RFC2882: https://tools.ietf.org/html/rfc2822#section-2.2.3

closes odoo/odoo#68069

X-original-commit: 559f6cf62711ad45557eddec3af7c66616724eb5
Signed-off-by: Julien Castiaux &lt;Julien00859@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: notification not sent when using the full composer</title>
<updated>2021-03-10T05:11:06+00:00</updated>
<author>
<name>Priyanka Kakadiya</name>
<email>pka@odoo.com</email>
</author>
<published>2021-02-17T12:20:25+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c65dff39af6ff84d6be8d9f28684773e32c0e8ca'/>
<id>c65dff39af6ff84d6be8d9f28684773e32c0e8ca</id>
<content type='text'>
Current behavior before PR:
mail notification not sent when using the full composer.

Desired behavior after PR is merged:
mail notification will send when using the full composer.

LINKS:
PR https://github.com/odoo/odoo/pull/66421
Task-2446855

closes odoo/odoo#66421

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current behavior before PR:
mail notification not sent when using the full composer.

Desired behavior after PR is merged:
mail notification will send when using the full composer.

LINKS:
PR https://github.com/odoo/odoo/pull/66421
Task-2446855

closes odoo/odoo#66421

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: fallback on English message</title>
<updated>2021-02-04T09:40:00+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2021-02-04T09:40:00+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=80f05addf48dd57da9ae78f39116a9b23f60529a'/>
<id>80f05addf48dd57da9ae78f39116a9b23f60529a</id>
<content type='text'>
In case of bad translation that doesn't contain the placeholder

Context:
A bad Japanese translation was inserted

  #. module: mail
  #: code:addons/mail/models/mail_thread.py:0
  #, python-format
  msgid "Create new %(document)s"
  msgstr "新しい%(ドキュメント)を作成する"

The translation has been corrected but use the 14.0 syntax of _ method
to include placeholders and fallback on the English source term in
case of bad translation
cf odoo/odoo#52155

closes odoo/odoo#65517

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case of bad translation that doesn't contain the placeholder

Context:
A bad Japanese translation was inserted

  #. module: mail
  #: code:addons/mail/models/mail_thread.py:0
  #, python-format
  msgid "Create new %(document)s"
  msgstr "新しい%(ドキュメント)を作成する"

The translation has been corrected but use the 14.0 syntax of _ method
to include placeholders and fallback on the English source term in
case of bad translation
cf odoo/odoo#52155

closes odoo/odoo#65517

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FW][FIX] mail: fix auto subscribe subtypes computation</title>
<updated>2021-01-19T16:33:20+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-11-26T15:01:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=01254f06e8ea37887e190758cc479a098591ab8e'/>
<id>01254f06e8ea37887e190758cc479a098591ab8e</id>
<content type='text'>
This commit contains a followup / rewrite / backport of #34150 :

  * odoo/odoo@16dd3da
  * odoo/odoo@0b11ed8

Fix: propagate generic internal subtypes from parent to childs with auto
subscribe.

  With this commit, when the user subscribes to internal subtypes like
  activities on a parent record (e.g. a project) then the user follows them
  by default on every sub record creation (e.g. all new tasks of this project).

Fix: do not reset existing subtypes when changing parent of a record using
auto subscribe mechanism.

  With this commit, when changing subtype subscription from a parent record
  (e.g. project) avoid resetting all subtypes subscription on existing sub
  records (e.g. all new tasks of this project). Only new records will use the
  parent chosen subtypes. This is done through propagation of followers
  existing policy (see Follower._insert_followers() for more details);

Note that fix done here is slightly different from the one done in odoo/odoo@16dd3da
as there was some mismatch with internal model-related subtypes. Thix fix
will be forward ported and improve the previous one.

Task ID-2205643
COM PR #47336

X-original-commit: odoo/odoo@9e7092a03f6c44287c661e2b39a943d240aa2bde
X-original-PR: odoo/odoo#47336

Co-Authored-By: Thibault Delavallee &lt;tde@odoo.com&gt;
Co-Authored-By: Alexandre Khun &lt;aku@odoo.com&gt;
Co-Authored-By: Priyanka kakadiya &lt;pka@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit contains a followup / rewrite / backport of #34150 :

  * odoo/odoo@16dd3da
  * odoo/odoo@0b11ed8

Fix: propagate generic internal subtypes from parent to childs with auto
subscribe.

  With this commit, when the user subscribes to internal subtypes like
  activities on a parent record (e.g. a project) then the user follows them
  by default on every sub record creation (e.g. all new tasks of this project).

Fix: do not reset existing subtypes when changing parent of a record using
auto subscribe mechanism.

  With this commit, when changing subtype subscription from a parent record
  (e.g. project) avoid resetting all subtypes subscription on existing sub
  records (e.g. all new tasks of this project). Only new records will use the
  parent chosen subtypes. This is done through propagation of followers
  existing policy (see Follower._insert_followers() for more details);

Note that fix done here is slightly different from the one done in odoo/odoo@16dd3da
as there was some mismatch with internal model-related subtypes. Thix fix
will be forward ported and improve the previous one.

Task ID-2205643
COM PR #47336

X-original-commit: odoo/odoo@9e7092a03f6c44287c661e2b39a943d240aa2bde
X-original-PR: odoo/odoo#47336

Co-Authored-By: Thibault Delavallee &lt;tde@odoo.com&gt;
Co-Authored-By: Alexandre Khun &lt;aku@odoo.com&gt;
Co-Authored-By: Priyanka kakadiya &lt;pka@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Do not consider reply if no "To:" is found</title>
<updated>2021-01-14T09:23:15+00:00</updated>
<author>
<name>Jairo Llopis</name>
<email>jairo.llopis@tecnativa.com</email>
</author>
<published>2020-04-16T12:34:38+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fda91de992cb96f0a867844cd2a356ab98e8f80e'/>
<id>fda91de992cb96f0a867844cd2a356ab98e8f80e</id>
<content type='text'>
If an email was sent with empty "To:" and a proper alias in "CC:" (or any of the similar valid headers that conform the `rpc_tos_localparts` array), before 40ae36b7f8c412cd96dc9592d8d1fb90de1e52d2 the email wouldn't get rejected. After that commit it would get bounced.

This comes from the not-so-obvious new python idiom used, `all()`. Check this out:

```python
&gt;&gt;&gt; all([False])
False
&gt;&gt;&gt; all([])
True
```

So, apart from the fix introduced in that commit, which seems valid, we have to make sure `email_to_localparts` actually has contents. Otherwise we are producing false bounces here.

@Tecnativa TT23437

closes odoo/odoo#64522

X-original-commit: 8f094d3c01a6ad150b7945115cda515dbde1f4bc
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an email was sent with empty "To:" and a proper alias in "CC:" (or any of the similar valid headers that conform the `rpc_tos_localparts` array), before 40ae36b7f8c412cd96dc9592d8d1fb90de1e52d2 the email wouldn't get rejected. After that commit it would get bounced.

This comes from the not-so-obvious new python idiom used, `all()`. Check this out:

```python
&gt;&gt;&gt; all([False])
False
&gt;&gt;&gt; all([])
True
```

So, apart from the fix introduced in that commit, which seems valid, we have to make sure `email_to_localparts` actually has contents. Otherwise we are producing false bounces here.

@Tecnativa TT23437

closes odoo/odoo#64522

X-original-commit: 8f094d3c01a6ad150b7945115cda515dbde1f4bc
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: send notification mail with right access link when using mail.thread</title>
<updated>2021-01-06T17:03:53+00:00</updated>
<author>
<name>Achraf (abz)</name>
<email>abz@odoo.com</email>
</author>
<published>2020-10-23T06:47:54+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=79f27f640ccdd14f285a9dd9fc0ae770c992376f'/>
<id>79f27f640ccdd14f285a9dd9fc0ae770c992376f</id>
<content type='text'>
PURPOSE

Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.

HOW TO REPRODUCE

Issue

    - Install "Approvals"
    - Submit new approval with you as "Request Owner"
    - Click on "View Approval Request" in your mailbox

    The link redirects to a 505 error

Cause

    The model is not the correct one and the res_id is undefined

Solution

    Specify the model and the res_id to _notify_get_action_link
    when creating the link with kwargs

SPECIFICATIONS

Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.

Also limit values given as URL parameters to some white listed values.

LINKS

opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545
Closes odoo/odoo#63292
Closes odoo/enterprise#15585

closes odoo/odoo#64170

X-original-commit: 2b6d2b71f6c60bcf64db440473c88d1dc335acbf
Related: odoo/enterprise#15588
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Co-authored-by: Achraf Ben Azzouz &lt;abz@odoo.com&gt;
Co-authored-by: Thibault Delavallée &lt;tde@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.

HOW TO REPRODUCE

Issue

    - Install "Approvals"
    - Submit new approval with you as "Request Owner"
    - Click on "View Approval Request" in your mailbox

    The link redirects to a 505 error

Cause

    The model is not the correct one and the res_id is undefined

Solution

    Specify the model and the res_id to _notify_get_action_link
    when creating the link with kwargs

SPECIFICATIONS

Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.

Also limit values given as URL parameters to some white listed values.

LINKS

opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545
Closes odoo/odoo#63292
Closes odoo/enterprise#15585

closes odoo/odoo#64170

X-original-commit: 2b6d2b71f6c60bcf64db440473c88d1dc335acbf
Related: odoo/enterprise#15588
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Co-authored-by: Achraf Ben Azzouz &lt;abz@odoo.com&gt;
Co-authored-by: Thibault Delavallée &lt;tde@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Receive EML file in attachment</title>
<updated>2020-12-11T12:42:17+00:00</updated>
<author>
<name>Julien Castiaux</name>
<email>juc@odoo.com</email>
</author>
<published>2020-12-10T16:10:47+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e628defec14f3b36612951bc698fa51b7c9f56bb'/>
<id>e628defec14f3b36612951bc698fa51b7c9f56bb</id>
<content type='text'>
Configure the incomming mail server, use another mail client to send a
message to Odoo with an EML file as attachment. The fetchmail server
fails.

Since the introduction of the new EmailMessage python API to
encode/decode email messages, every EML attachment is automatically
parsed into a EmailMessage.

closes odoo/odoo#63191

Task: 2329606
Signed-off-by: Julien Castiaux &lt;Julien00859@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Configure the incomming mail server, use another mail client to send a
message to Odoo with an EML file as attachment. The fetchmail server
fails.

Since the introduction of the new EmailMessage python API to
encode/decode email messages, every EML attachment is automatically
parsed into a EmailMessage.

closes odoo/odoo#63191

Task: 2329606
Signed-off-by: Julien Castiaux &lt;Julien00859@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
