<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/mail/models/mail_notification.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>[FIX] mail: don't self-notify</title>
<updated>2020-11-07T19:34:29+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2020-11-07T19:34:29+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a98eb03c9163188eae471e2542a0746fa6854d20'/>
<id>a98eb03c9163188eae471e2542a0746fa6854d20</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Sending a sms on an opportunity without customer</title>
<updated>2020-11-05T12:40:47+00:00</updated>
<author>
<name>Goffin Simon</name>
<email>sig@odoo.com</email>
</author>
<published>2020-11-04T15:02:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=651da2fe8694ed0003a9dd0801c71f2ef26cedb9'/>
<id>651da2fe8694ed0003a9dd0801c71f2ef26cedb9</id>
<content type='text'>
Steps to reproduce the bug:

- Create an opportunity without a customer but with a phone number
- Send a sms
- Refesh the page

Bug:

A traceback was raised because an entry is created in mail_message_res_partner_needaction_rel
with partner_id = False

Due to https://github.com/odoo/odoo/blob/14.0/addons/sms/models/mail_thread.py#L327

A mail.notification is created from a sms even if there is no partner set on the sms

opw:2372201

closes odoo/odoo#61341

Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce the bug:

- Create an opportunity without a customer but with a phone number
- Send a sms
- Refesh the page

Bug:

A traceback was raised because an entry is created in mail_message_res_partner_needaction_rel
with partner_id = False

Due to https://github.com/odoo/odoo/blob/14.0/addons/sms/models/mail_thread.py#L327

A mail.notification is created from a sms even if there is no partner set on the sms

opw:2372201

closes odoo/odoo#61341

Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web, *: improve mock server and replace most mail mockRPC</title>
<updated>2020-08-13T16:26:35+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2020-08-13T16:26:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c2918c139b8f1026b57a257fbb74570d7a224c98'/>
<id>c2918c139b8f1026b57a257fbb74570d7a224c98</id>
<content type='text'>
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  -&gt;`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -&gt; only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -&gt; easier to mock than session

- remove usage of `need_moderation`
  -&gt; that was just a search indirection to `moderation_status`

- adapt `partner_id` -&gt; `res_partner_id` key in `_notification_format`
  -&gt; to be consistent with field name

- add name in result of `mail_partner_format`
  -&gt; sometimes display_name is not the same

- remove usage of `is_moderator`
  -&gt; that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
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>
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  -&gt;`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -&gt; only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -&gt; easier to mock than session

- remove usage of `need_moderation`
  -&gt; that was just a search indirection to `moderation_status`

- adapt `partner_id` -&gt; `res_partner_id` key in `_notification_format`
  -&gt; to be consistent with field name

- add name in result of `mail_partner_format`
  -&gt; sometimes display_name is not the same

- remove usage of `is_moderator`
  -&gt; that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] mail, *: refactor messaging with OWL</title>
<updated>2020-06-15T18:12:21+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2020-06-15T18:12:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3fea5b2136627c1d7e83b2a5e111952fe3eb10a1'/>
<id>3fea5b2136627c1d7e83b2a5e111952fe3eb10a1</id>
<content type='text'>
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) &lt;aku@odoo.com&gt;
Co-authored-by: Alexandre Kühn &lt;aku@odoo.com&gt;
Co-authored-by: Julien Giannone &lt;jgi@odoo.com&gt;
Co-authored-by: Lucas Perais &lt;lpe@odoo.com&gt;
Co-authored-by: Sébastien Theys &lt;seb@odoo.com&gt;
Co-authored-by: Xavier Dubuc &lt;xdu@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) &lt;aku@odoo.com&gt;
Co-authored-by: Alexandre Kühn &lt;aku@odoo.com&gt;
Co-authored-by: Julien Giannone &lt;jgi@odoo.com&gt;
Co-authored-by: Lucas Perais &lt;lpe@odoo.com&gt;
Co-authored-by: Sébastien Theys &lt;seb@odoo.com&gt;
Co-authored-by: Xavier Dubuc &lt;xdu@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[LNT] mail: lint and reorder mail_notification files</title>
<updated>2020-04-22T08:40:04+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-04-15T09:36:59+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=42b5ec03845ecd5b31c0f9202cb4be47329bd240'/>
<id>42b5ec03845ecd5b31c0f9202cb4be47329bd240</id>
<content type='text'>
In this commit we order fields more logically to ease reading and prepare
future modifications. We also rename the class and some field strings to
be more user friendly.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891

Co-Authored-By: Rémy Voet &lt;ryv@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>
In this commit we order fields more logically to ease reading and prepare
future modifications. We also rename the class and some field strings to
be more user friendly.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891

Co-Authored-By: Rémy Voet &lt;ryv@odoo.com&gt;
Co-Authored-By: Thibault Delavallée &lt;tde@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail, sms, snailmail, test_mail_full: adapt mail.notification</title>
<updated>2020-04-17T12:17:57+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2020-04-17T09:53:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=dea52493b819939ae16391d8b19c2f404c7ec143'/>
<id>dea52493b819939ae16391d8b19c2f404c7ec143</id>
<content type='text'>
The purpose is to have more common code for failure and notifications, with less
override in `sms` and `snailmail`.

task-2176017

closes odoo/odoo#44170

Related: odoo/enterprise#9140
Related: odoo/upgrade#918
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>
The purpose is to have more common code for failure and notifications, with less
override in `sms` and `snailmail`.

task-2176017

closes odoo/odoo#44170

Related: odoo/enterprise#9140
Related: odoo/upgrade#918
Signed-off-by: Alexandre Kühn (aku) &lt;aku@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: gc more notification.</title>
<updated>2019-08-05T16:13:54+00:00</updated>
<author>
<name>Xavier-Do</name>
<email>xdo@odoo.com</email>
</author>
<published>2019-08-05T11:20:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4f44ad4fe4e670eedb357bf5c04972c597fa3d5b'/>
<id>4f44ad4fe4e670eedb357bf5c04972c597fa3d5b</id>
<content type='text'>
This gc option should delete more notifications: we only keep notification
not send, and set inbox notification as sent.

closes odoo/odoo#30067

Signed-off-by: Xavier Dollé (xdo) &lt;xdo@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>
This gc option should delete more notifications: we only keep notification
not send, and set inbox notification as sent.

closes odoo/odoo#30067

Signed-off-by: Xavier Dollé (xdo) &lt;xdo@odoo.com&gt;


Co-authored-by: Thibault Delavallée &lt;tde@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail, test_mail: new 'History' mailbox in Discuss</title>
<updated>2019-08-05T11:50:19+00:00</updated>
<author>
<name>Nikunj Ladava</name>
<email>nla@odoo.com</email>
</author>
<published>2018-02-02T06:21:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0c37b9fb39005eab70ee8b39da84f79c981b2695'/>
<id>0c37b9fb39005eab70ee8b39da84f79c981b2695</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[REM] *: calls to @api.multi</title>
<updated>2019-07-17T12:13:12+00:00</updated>
<author>
<name>Adrian Torres</name>
<email>adt@odoo.com</email>
</author>
<published>2019-07-10T12:59:37+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4b38cc6590abcb58a0ca102a06063eb3db7ac1f4'/>
<id>4b38cc6590abcb58a0ca102a06063eb3db7ac1f4</id>
<content type='text'>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] sms: refactor message_post using SMS notifications</title>
<updated>2019-07-12T14:54:11+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-05-23T10:09:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bdebcab0cea467e070c1936fed16173247abafdd'/>
<id>bdebcab0cea467e070c1936fed16173247abafdd</id>
<content type='text'>
Purpose of this commit is to better include SMS notifications when posting a
message. SMS is now just another way of notifying people along with Inbox and
email. Following recent mail merge improving notification mechanism [1] we
have to define a _notify_record_by_sms method on mail.thread.

When a message_post is done using message_type being ``sms`` notification type
of customers is set to sms. Customers can be computed on model (generally based
on partner_id field) or directly set usign partner°ids. Notification model is
updated to store this information directly inside the notification itself.

An new ``_message_sms`` helper method is introduced in SMS module allowing
to send messages using sms type and notification with a reduced parameters
number. It is just a shortcut to message_post, easier to use. Either it
computes default recipients on the record set, either it is based on given
partners and numbers to notify.

The following use cases are notably supported

  * default computation: find customer, notify by sms;
  * force recipients to notify by sms (partner_ids);
  * give a set of numbers to notify by sms (sms_nubmers), not necessarily
    linked to existing partners;
  * force number / customer relationship independently of mobile number defined
    on customer (for example when sending an SMS directly from a mobile field
    on a lead linked to a customer);

Tests are updated accordingly. Performance tests are added in order to have
some insights on queries generated when sending SMS, like already done for
mail.thread alone.

Related to task 1922163
Linked to PR #33510

[1] see be2795513644f09f6b443f462bb67cc5a0762e8d: performance and notification code improvements

Co-Authored-By: Thibault Delavallee &lt;tde@odoo.com&gt;
Co-Authored-By: Pierre Rousseau &lt;pro@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose of this commit is to better include SMS notifications when posting a
message. SMS is now just another way of notifying people along with Inbox and
email. Following recent mail merge improving notification mechanism [1] we
have to define a _notify_record_by_sms method on mail.thread.

When a message_post is done using message_type being ``sms`` notification type
of customers is set to sms. Customers can be computed on model (generally based
on partner_id field) or directly set usign partner°ids. Notification model is
updated to store this information directly inside the notification itself.

An new ``_message_sms`` helper method is introduced in SMS module allowing
to send messages using sms type and notification with a reduced parameters
number. It is just a shortcut to message_post, easier to use. Either it
computes default recipients on the record set, either it is based on given
partners and numbers to notify.

The following use cases are notably supported

  * default computation: find customer, notify by sms;
  * force recipients to notify by sms (partner_ids);
  * give a set of numbers to notify by sms (sms_nubmers), not necessarily
    linked to existing partners;
  * force number / customer relationship independently of mobile number defined
    on customer (for example when sending an SMS directly from a mobile field
    on a lead linked to a customer);

Tests are updated accordingly. Performance tests are added in order to have
some insights on queries generated when sending SMS, like already done for
mail.thread alone.

Related to task 1922163
Linked to PR #33510

[1] see be2795513644f09f6b443f462bb67cc5a0762e8d: performance and notification code improvements

Co-Authored-By: Thibault Delavallee &lt;tde@odoo.com&gt;
Co-Authored-By: Pierre Rousseau &lt;pro@odoo.com&gt;</pre>
</div>
</content>
</entry>
</feed>
