<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/test_mail/tests/test_message_post.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>[IMP] event, mail, mass_mailing, sms, test_mail: clean some mail tests tools helpers and parameters</title>
<updated>2021-04-08T15:06:12+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2021-04-07T09:17:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c75e8619663efc4d97ab13fb35f815104239dd36'/>
<id>c75e8619663efc4d97ab13fb35f815104239dd36</id>
<content type='text'>
In this commit we backport some of 14.1+ improvements done in mail tools
in order to keep a coherent definition through sub versions. We also
improve docstring and add some explanations on available toold and asserts.

Task ID-2500615
COM PR odoo/odoo#68874</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this commit we backport some of 14.1+ improvements done in mail tools
in order to keep a coherent definition through sub versions. We also
improve docstring and add some explanations on available toold and asserts.

Task ID-2500615
COM PR odoo/odoo#68874</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>[REV][FIX] mail: Send mail with correct access link</title>
<updated>2020-11-12T08:08:57+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-11-10T13:58:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e861f7294a7bd6bde056b987f15e48df4b0ab877'/>
<id>e861f7294a7bd6bde056b987f15e48df4b0ab877</id>
<content type='text'>
This reverts commit fbd30f4266d86b53aa4b13b72a93bccee0d7eb69. Indeed kwargs
are used to build a link, meaning message value are given to some links when
using message_notify.

A better fix will be provided soon. Reverting to avoid issues in stable.

closes odoo/odoo#61604

X-original-commit: a5362345d51cfddf4e34f64a30238395f4453eb3
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fbd30f4266d86b53aa4b13b72a93bccee0d7eb69. Indeed kwargs
are used to build a link, meaning message value are given to some links when
using message_notify.

A better fix will be provided soon. Reverting to avoid issues in stable.

closes odoo/odoo#61604

X-original-commit: a5362345d51cfddf4e34f64a30238395f4453eb3
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Send mail with correct access link</title>
<updated>2020-11-06T11:04:41+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=075325226d6f7c2af638013f25613ddd391e506b'/>
<id>075325226d6f7c2af638013f25613ddd391e506b</id>
<content type='text'>
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

opw-2358846

closes odoo/odoo#61463

X-original-commit: bb89abb057acef57ee1a791beb661ada013ec7b9
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: Achraf &lt;abz-odoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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

opw-2358846

closes odoo/odoo#61463

X-original-commit: bb89abb057acef57ee1a791beb661ada013ec7b9
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: Achraf &lt;abz-odoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website_livechat: missing decorator on message_post</title>
<updated>2020-09-04T17:03:09+00:00</updated>
<author>
<name>Didier (did)</name>
<email>did@odoo.com</email>
</author>
<published>2020-09-04T10:09:46+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8bc94d9b1ab1922d13ca90079e3ec4dca543c537'/>
<id>8bc94d9b1ab1922d13ca90079e3ec4dca543c537</id>
<content type='text'>
Incorrect override of message_post.
Without this decorator, message_post returns a string `mail.message(ID,)` via
RPC. Discuss needs the message ID to scroll chat window

closes odoo/odoo#57122

X-original-commit: 3939d3aa3b60e0f606a9f7defd695417f7b3f383
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Incorrect override of message_post.
Without this decorator, message_post returns a string `mail.message(ID,)` via
RPC. Discuss needs the message ID to scroll chat window

closes odoo/odoo#57122

X-original-commit: 3939d3aa3b60e0f606a9f7defd695417f7b3f383
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[IMP] test_mail(_full): run tests at post_install"</title>
<updated>2020-01-23T09:19:12+00:00</updated>
<author>
<name>Xavier-Do</name>
<email>xdo@odoo.com</email>
</author>
<published>2020-01-23T09:19:12+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8970127c036a138c7cdc19ec67cc3553b13d4913'/>
<id>8970127c036a138c7cdc19ec67cc3553b13d4913</id>
<content type='text'>
This reverts commit 976e560a877bcaf9e769b6005d33bd49833eceb9.

Even if it didn't looked like a bad idea, this need some more thinking.
This new version of query count creates random failure of runbot builds.

closes odoo/odoo#43820

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 976e560a877bcaf9e769b6005d33bd49833eceb9.

Even if it didn't looked like a bad idea, this need some more thinking.
This new version of query count creates random failure of runbot builds.

closes odoo/odoo#43820

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] test_mail(_full): run tests at post_install</title>
<updated>2020-01-22T13:36:22+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2020-01-22T13:32:53+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=976e560a877bcaf9e769b6005d33bd49833eceb9'/>
<id>976e560a877bcaf9e769b6005d33bd49833eceb9</id>
<content type='text'>
- take advantage of runbot multi-build capabilities
- get similar result when running them locally during dev
- better detect when other modules add extra queries

Query counts are split in the base value (testing with just test_mail installed)
+ the extra modules overhead.

Part of task-2178641

closes odoo/odoo#43666

Pr: #43666
Signed-off-by: Alexandre Kühn (aku) &lt;aku@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- take advantage of runbot multi-build capabilities
- get similar result when running them locally during dev
- better detect when other modules add extra queries

Query counts are split in the base value (testing with just test_mail installed)
+ the extra modules overhead.

Part of task-2178641

closes odoo/odoo#43666

Pr: #43666
Signed-off-by: Alexandre Kühn (aku) &lt;aku@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] mail, various: rename subtype parameter of message_post to subtype_xmlid</title>
<updated>2019-12-02T15:18:44+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-10-24T11:09:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e2b33f460d0f2359e65107f8615c7e827350b4e7'/>
<id>e2b33f460d0f2359e65107f8615c7e827350b4e7</id>
<content type='text'>
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: restrict access to mail.mail model</title>
<updated>2019-11-29T13:35:14+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-10-24T09:05:16+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=69ccabb212d83bfee60c7dade36ca4b06f9f2f12'/>
<id>69ccabb212d83bfee60c7dade36ca4b06f9f2f12</id>
<content type='text'>
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.

We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.

Task ID 1853147
PR #32243</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.

We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.

Task ID 1853147
PR #32243</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] test_mail: update test message post to new common</title>
<updated>2019-11-20T16:01:03+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-09-10T14:27:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=363bdc16c7f03ba0f323bc9afbf1878de44fa008'/>
<id>363bdc16c7f03ba0f323bc9afbf1878de44fa008</id>
<content type='text'>
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test message post

LINKS

Task ID 2068986
PR #38070</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test message post

LINKS

Task ID 2068986
PR #38070</pre>
</div>
</content>
</entry>
</feed>
