<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/sms/tests/common.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_sms, link_tracker, sms, test_mail_full: improve SMS-based mailing tests</title>
<updated>2021-04-19T14:11:13+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2021-04-16T11:52:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e77b9e575e398f42df524bdaf5d692ea882a4521'/>
<id>e77b9e575e398f42df524bdaf5d692ea882a4521</id>
<content type='text'>
PURPOSE

Purpose is to have more tests when sending sms mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.

SPECIFICATIONS

In this commit we improve SMS Marketing mailing tests. We notably

  * add tests for void and invalid email and numbers. It allows to check they
    correctly update their trace status;
  * add tests for unsubscribe and view links embedded in sms marketing;
  * add tests to simulate a click on links sent through sms marketing and
    ensure click statistics are effectively updated;
  * ensure content of sent sms are checked;

Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.

In event we now correctly use sms gateway mock to ensure SMS finding.

In link_tracker a helper is added to check url tracking in plaintext content.

LINKS

Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Purpose is to have more tests when sending sms mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.

SPECIFICATIONS

In this commit we improve SMS Marketing mailing tests. We notably

  * add tests for void and invalid email and numbers. It allows to check they
    correctly update their trace status;
  * add tests for unsubscribe and view links embedded in sms marketing;
  * add tests to simulate a click on links sent through sms marketing and
    ensure click statistics are effectively updated;
  * ensure content of sent sms are checked;

Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.

In event we now correctly use sms gateway mock to ensure SMS finding.

In link_tracker a helper is added to check url tracking in plaintext content.

LINKS

Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] sms, link_tracker: clean some test helpers and add an helper to click SMS links</title>
<updated>2020-05-26T10:35:58+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-05-26T09:50:51+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e8b1e2b7e448e0e29ca75c1585814788345c643b'/>
<id>e8b1e2b7e448e0e29ca75c1585814788345c643b</id>
<content type='text'>
Clean some helpers, and add a helper to simulata a click on a shortened link
embedded in an SMS.

Task ID 2247037
Community PR #50384</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clean some helpers, and add a helper to simulata a click on a shortened link
embedded in an SMS.

Task ID 2247037
Community PR #50384</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] sms: fix test helpers calling a removed method</title>
<updated>2020-05-26T10:35:58+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-05-26T08:13:07+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c13c3318b2eb32366fe342edb934461c4efbffcd'/>
<id>c13c3318b2eb32366fe342edb934461c4efbffcd</id>
<content type='text'>
Fix a crash when calling assertSMSStatistics without a number but taking the
number from a partner.

Also fix "sent" sms helper, content should be optional like other helpers.

Task ID 2247037
Community PR #50384</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a crash when calling assertSMSStatistics without a number but taking the
number from a partner.

Also fix "sent" sms helper, content should be optional like other helpers.

Task ID 2247037
Community PR #50384</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] (test_)(mass_)mail(_full): rename and reorganize mail related test classes</title>
<updated>2020-05-26T10:35:58+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-04-29T11:38:20+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4a2ac044f8bd4a5a1f96f0e45c008473dc15eec3'/>
<id>4a2ac044f8bd4a5a1f96f0e45c008473dc15eec3</id>
<content type='text'>
Modules holding tests and helpers

  * link_tracker: mainly mock, asserts and tools for link tracker tests
    (MockLinkTracker);
  * mail: mainly gateway mock and base for mail tests
    * MockEmail -&gt; mocks for mail gateway;
    * MailCase -&gt; tools and asserts for mail tests;
    * MailCommon -&gt;     base for mail functional tests);

  * sms: mainly SMS gateway mock and base for sms tests
    * MockSMS -&gt; mocks for SMS gateway;
    * SMS Case -&gt; tools and asserts for mail / SMS tests;
    * SMSCommon -&gt; update of MailCommon with SMS capabilities);

  * mass_mailing: mainly asserts and tools for mass mailing tests
    * MassMailCase -&gt; update of MailCase for mass mailing tools and asserts;
    * MassMailCommon -&gt; update of MailCommon with mass mailing);

  * mass_mailing_sms: mainly asserts and tools for mass SMS tests
    * MockMassSMS -&gt; update of MockSMS for mass SMS tools and asserts;
    * MassSMSCommon -&gt; update of MassMailCommon with SMS capabilities);

Modules for tests

  * test_mail: module for mail app tests (TestMailCommon);
  * test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
  * test_mail_full: tests integrating all discuss features, currently mainly
    mail and SMS (TestMailFullCommon);

Enterprise: update test_mail_enterprise and test_marketing_automation

Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modules holding tests and helpers

  * link_tracker: mainly mock, asserts and tools for link tracker tests
    (MockLinkTracker);
  * mail: mainly gateway mock and base for mail tests
    * MockEmail -&gt; mocks for mail gateway;
    * MailCase -&gt; tools and asserts for mail tests;
    * MailCommon -&gt;     base for mail functional tests);

  * sms: mainly SMS gateway mock and base for sms tests
    * MockSMS -&gt; mocks for SMS gateway;
    * SMS Case -&gt; tools and asserts for mail / SMS tests;
    * SMSCommon -&gt; update of MailCommon with SMS capabilities);

  * mass_mailing: mainly asserts and tools for mass mailing tests
    * MassMailCase -&gt; update of MailCase for mass mailing tools and asserts;
    * MassMailCommon -&gt; update of MailCommon with mass mailing);

  * mass_mailing_sms: mainly asserts and tools for mass SMS tests
    * MockMassSMS -&gt; update of MockSMS for mass SMS tools and asserts;
    * MassSMSCommon -&gt; update of MassMailCommon with SMS capabilities);

Modules for tests

  * test_mail: module for mail app tests (TestMailCommon);
  * test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
  * test_mail_full: tests integrating all discuss features, currently mainly
    mail and SMS (TestMailFullCommon);

Enterprise: update test_mail_enterprise and test_marketing_automation

Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] sms: Add new failure status for unregistered accounts</title>
<updated>2020-05-12T16:39:40+00:00</updated>
<author>
<name>Rémi Rahir</name>
<email>rar@odoo.com</email>
</author>
<published>2020-03-27T17:28:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7287800101ba6d054960b906da3a5a538abcb02f'/>
<id>7287800101ba6d054960b906da3a5a538abcb02f</id>
<content type='text'>
Since January 2020, users are required to validate their IAP account via
SMS code validation. This new behaviour needed to be properly ported to
the client to correctly inform the user.

This commit adds support of a new failure_type: 'Unregistered Account'.

Task #2209567

closes odoo/odoo#48512

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since January 2020, users are required to validate their IAP account via
SMS code validation. This new behaviour needed to be properly ported to
the client to correctly inform the user.

This commit adds support of a new failure_type: 'Unregistered Account'.

Task #2209567

closes odoo/odoo#48512

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX][IMP] sms: create failed notification when SMS-ing record without any phone number</title>
<updated>2020-04-30T14:47:49+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-04-30T13:27:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c5c7a02302f6095c2ecf1e215421a8c9ff630638'/>
<id>c5c7a02302f6095c2ecf1e215421a8c9ff630638</id>
<content type='text'>
When no valid phone number was found on a record, and when using _message_sms
directly, no SMS and no notification was created. You could therefore think
everything was ok while it was actually not.

Instead we now create failed notifications. It allows to be notified of it
and fix numbers through cancel / resend wizards.

Task ID 2244192

closes odoo/odoo#50486

X-original-commit: baecdfaa2d31714a20d1fb8af7799af1805cd939
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When no valid phone number was found on a record, and when using _message_sms
directly, no SMS and no notification was created. You could therefore think
everything was ok while it was actually not.

Instead we now create failed notifications. It allows to be notified of it
and fix numbers through cancel / resend wizards.

Task ID 2244192

closes odoo/odoo#50486

X-original-commit: baecdfaa2d31714a20d1fb8af7799af1805cd939
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] sms: fix crash when using composer on a record without valid phone number</title>
<updated>2020-04-30T14:47:49+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-04-30T13:11:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9a3581d925af1a00849418608fd5db6d3cae203b'/>
<id>9a3581d925af1a00849418608fd5db6d3cae203b</id>
<content type='text'>
When no valid phone number was found on a record, and when using the composer
in single recipient mode, you had a crash at sending as composer tried to
write on a field called False.

Instead we just take the first available phone field of the record. As they
are all void we can update them safely.

Task ID 2244192

X-original-commit: 2306d7d79d8e64597912f15365cede7473589731</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When no valid phone number was found on a record, and when using the composer
in single recipient mode, you had a crash at sending as composer tried to
write on a field called False.

Instead we just take the first available phone field of the record. As they
are all void we can update them safely.

Task ID 2244192

X-original-commit: 2306d7d79d8e64597912f15365cede7473589731</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] sms: improve onboarding and user experience of SMS composer</title>
<updated>2019-08-12T12:00:22+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-08-05T15:56:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=5450415354233671fe42f62c3b095d03c1389317'/>
<id>5450415354233671fe42f62c3b095d03c1389317</id>
<content type='text'>
PURPOSE

SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...

Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.

SPECIFICATIONS

Clean the use and options of sms composer after FP feedback :

  * see https://s.nimbusweb.me/share/3167586/ap1xpy95rz29a5cys576 as basis;
  * globally, do not display invalid recipients, only valid / invalid count
    as well as current selection / active domain counts;
  * consider logging a note as default behavior when using the composer;
  * simplify code: when doing a mass SMS, send SMS and attach a simple note
    to the document;

Some other points

  * make name of sms templates translatable;
  * improve various wording, notably in sms widget;
  * display error code in sms list view;
  * update sms composer actions accordingly by correctly setting active id
    or ids;

LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...

Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.

SPECIFICATIONS

Clean the use and options of sms composer after FP feedback :

  * see https://s.nimbusweb.me/share/3167586/ap1xpy95rz29a5cys576 as basis;
  * globally, do not display invalid recipients, only valid / invalid count
    as well as current selection / active domain counts;
  * consider logging a note as default behavior when using the composer;
  * simplify code: when doing a mass SMS, send SMS and attach a simple note
    to the document;

Some other points

  * make name of sms templates translatable;
  * improve various wording, notably in sms widget;
  * display error code in sms list view;
  * update sms composer actions accordingly by correctly setting active id
    or ids;

LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] phone_validation: add blacklist mechanism</title>
<updated>2019-08-12T12:00:22+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2019-07-19T09:45:24+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7e8a02cd6e9f08e5ff45db804b357bc3537ff1f6'/>
<id>7e8a02cd6e9f08e5ff45db804b357bc3537ff1f6</id>
<content type='text'>
PURPOSE

SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...

Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.

SPECIFICATIONS

Purpose of this commit is to add a blacklist mechanism for phone numbers
used to send SMS like what already exists for email addresses when sending
emails.

Define a new phone.blacklist model, holding a number and the state of the
blacklist (active field), as well as tools methods to access it. Make it
as private as possible, accessing it in sudo once access are granted.

Also clean phone validation tools: lessen number of tool functions and update
caller to simplify code readability. Some fixes are also included in this
commit, notably blank spaces cleaning in phone numbers.

Improve phone.validation.mixin to add a tool method computing a sanitized
number, in addition to formatting it to national / international.

Define a new mail.thread.phone mixin computing the blacklist status of a
record. This mixin

  * inherit from phone.validation.mixin in order to have access to some
    base phone number parsing capabilities;
  * computes a sanitized phone number based on ´´_phone_get_number_fields´´.
    It takes first sanitized value, trying each field returned by the
    method. That means one sanitized phone number is available per record
    even if several fields are available;
  * compute blacklist state of records. It is based on phone.blacklist
    model and give an easy-to-use field and API to manipulate blacklisted
    records;
  * give some API methods :

    * ``_phone_set_blacklisted``: set recordset as blacklisted;
    * ``_phone_reset_blacklisted``: reactivate recordset (even if not blacklisted
        this method can be called safely);

Put menus in technical in order to have access to it. Add a Phone / SMS
menu below "Email" and use it to store SMS / Phone actions.

Finally prepare tests addition by performing some light cleaning while adding
blacklist tests. Purpose is to ease future tests related to SMS.

LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...

Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.

SPECIFICATIONS

Purpose of this commit is to add a blacklist mechanism for phone numbers
used to send SMS like what already exists for email addresses when sending
emails.

Define a new phone.blacklist model, holding a number and the state of the
blacklist (active field), as well as tools methods to access it. Make it
as private as possible, accessing it in sudo once access are granted.

Also clean phone validation tools: lessen number of tool functions and update
caller to simplify code readability. Some fixes are also included in this
commit, notably blank spaces cleaning in phone numbers.

Improve phone.validation.mixin to add a tool method computing a sanitized
number, in addition to formatting it to national / international.

Define a new mail.thread.phone mixin computing the blacklist status of a
record. This mixin

  * inherit from phone.validation.mixin in order to have access to some
    base phone number parsing capabilities;
  * computes a sanitized phone number based on ´´_phone_get_number_fields´´.
    It takes first sanitized value, trying each field returned by the
    method. That means one sanitized phone number is available per record
    even if several fields are available;
  * compute blacklist state of records. It is based on phone.blacklist
    model and give an easy-to-use field and API to manipulate blacklisted
    records;
  * give some API methods :

    * ``_phone_set_blacklisted``: set recordset as blacklisted;
    * ``_phone_reset_blacklisted``: reactivate recordset (even if not blacklisted
        this method can be called safely);

Put menus in technical in order to have access to it. Add a Phone / SMS
menu below "Email" and use it to store SMS / Phone actions.

Finally prepare tests addition by performing some light cleaning while adding
blacklist tests. Purpose is to ease future tests related to SMS.

LINKS

Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] sms: update and fix returned IAP state about badly formatted numbers</title>
<updated>2019-07-23T08:29:15+00:00</updated>
<author>
<name>Remi Rahir</name>
<email>rar@odoo.com</email>
</author>
<published>2019-07-22T09:35:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4968eb7c831cd227869273dc22de20578c830a93'/>
<id>4968eb7c831cd227869273dc22de20578c830a93</id>
<content type='text'>
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

wrong_format_number is actually now called wrong_number_format. This commit
propagates this renaming through SMS code and tests.

LINKS

Task 1922187

closes odoo/odoo#35025

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

Followup of merge 4287481 .

SPECIFICATIONS

wrong_format_number is actually now called wrong_number_format. This commit
propagates this renaming through SMS code and tests.

LINKS

Task 1922187

closes odoo/odoo#35025

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;</pre>
</div>
</content>
</entry>
</feed>
