- Change the name of "Mass SMS" by "SMS Marketing"
- Improve the Mass Mailing views (kanban, form)
- Improve the Mass SMS views (kanban, search, form)
- Hide the sanitized numbers from views (sometime replace by mobile)
- Fix demo data of sms
- Explain the language field of sms template
- Improve the render of the sms composer wizard
TASK_ID : 2053631
In the SMS template, we add the ability to create (and remove)
a contextual action on the targeted model from a sms template.
We change the sms composer to guess the composition mode,
and then to be usable by contextual action. The guess compostion mode
works differently if there are multiple target
selected (mass) or a single target (comment).
TASK_ID : 2053631
Add a way for the user to preview sms content from a sms
template depending of a record (targeted model) and the
installed languages (as for the mail template). Add button
to open this preview on the form of the sms template.
TASK_ID : 2053631
- Cancel button in the sms form view not related to a action :
When we click on the cancel button of the sms form view, get traceback.
Fix the issue by adding the cancel action in sms model.
- Mass mailing contact - False as the display name :
The display name was the mail address but when the contact didn't have
mail address a ugly False was print to described the contact (form view).
Then change the _rec_name to print the name as the display name.
- Fix SMS composer for the res.parnter tree
Only the first record was truely selected when open the sms composer
(mass) from the tree view of partner. Fix that by bind the actives_ids
in the context and also fix the names of related actions.
TASK_ID : 2053631
Since the refactoring, SMS is no longer in auto install. This is a shame
because we want to put forward the SMS features. In any case, the user can
always disable SMS from the General Settings if it is too invasive.
FP / AJU request.
Task 2057705
closesodoo/odoo#35946
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This is a performance optimization: modifying a regular record will not
trigger some recomputation on a transient record. Most transient
records are simply waiting to be garbage-collected, so there is no need
to keep their fields up-to-date.
closesodoo/odoo#35909
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This branch is the combination of several optimizations in the ORM:
* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;
* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;
* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);
* make method `modified` take advantage of inverse fields to inverse
dependencies;
* filter records by evaluating a domain on records in Python;
* a computed field with `readonly=False` behaves like a normal field
with an onchange method;
* computed fields are computed in superuser mode by default.
Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.
closesodoo/odoo#35659
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
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
Limit use of templates to models that are really capable of sending
SMS. Templates are now available on models that inherit from mail.thread
and effectively have fields used in SMS sending.
Technically this is done through a not stored field on ir.model that is
searchable. SMS sending capabilities is based on
* having fields holding phone numbers, as defined on mail.thread in SMS;
* having fields holding partners, as defined on mail.thread in SMS;
This implied some code rewriting notably about finding default SMS
recipients on a given model, in order to have fields instead of directly
returning partners.
LINKS
Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)
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)
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 support blacklisted and already-done numbers
when sending SMS.
* blacklist support: necessary to avoid sending SMS in batch to people that
asked to stop being spammed;
* already-done support: when performing mailing in batch or doing A/B testing
we may have already-done SMS;
When sending SMS in batch, already update state and error code of SMS that
should not be sent
* blacklisted number: set to canceled, with blacklist error code;
* duplicated number: set to canceled, with duplicated error code;
* invalid number (cannot sanitize): set to error, with either missing number
if void or wrong format if not void;
Support of blacklist / duplicated / invalid will notably be used when
performing SMS marketing (mass SMS) and marketing automation using mass
SMS.
LINKS
Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)
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)
Partner / Contact model may hold valid mobile numbers in mobile or phone
fields.
LINKS
Task 1997464
closesodoo/odoo#35599
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#35025
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Followup of merge 4287481 .
SPECIFICATIONS
Display "Missing number" in recipients invalid message when not having
any number to ease user experience;
Use note subtype when logging through composer, like already done in standard
sms API method at 2b7ad217f1a55a0687ba4ec4765bc7777114aac0;
LINKS
Task 1922187
PURPOSE
Followup of merge 4287481 .
SPECIFICATIONS
Notification type is now a selection -> use 'sms' instead of True;
Fix typo in method renaming not correctly propagated to its view;
LINKS
Task 1922187
PURPOSE
Improve SMS UX integration. Followup of merge 4287481 .
SPECIFICATIONS
Fix recent SMS merge: do not display tooltip / popover about SMS information
in chatter if there was no recipients linked to the SMS message.
LINKS
Task 1922187
PURPOSE
Send SMS from server/automated actions. Indeed we can already send emails from
server actions. The goal is to have the same thing for the sms.
SPECIFICATION
Purpose of this commit is to add support of sending batch SMS through
server actions. This means sending SMS will be available also for
automated (base automation) and scheduled actions (cron).
A new type of server action is added: sms. User choose an sms.template
to use to send SMS in batch. An option allow to choose to keep archive on
selected records. If no archive is kept, a batch of sms is created. With
archive a _message_sms is performed with note subtype, allowing to have
a discuss messages with only sms customer being notified.
Linked to task 1935280
Part of PR #34864
PURPOSE
Improve integration of SMS in various applications: calendar, contacts.
SPECIFICATIONS
Calendar_sms: set right composition mode on calendar event in form mode
aka comment
SMS: keep log when sending SMS in batch through action menu
Linked to task 1925950 and 1935280
Part of PR #34864
PURPOSE
Improve use of SMS. Followup of merge 4287481bf0 .
SPECIFICATIONS
Currently when sending an SMS through the UI a message is posted using the
comment subtype. However it is better to lessen number of notifications
and log using the note subtype as it is mainly a log to know something has
been sent.
Order SMS by ID desc to ease finding them in technical menu.
Mail, sms: fix wording of mail / SMS failures
Linked to task 1925950 and 1935280
Part of PR #34864
PURPOSE
Purpose of this commit is to add options and improve sms composer behavior.
Followup of merge 4287481bf0 .
SPECIFICATIONS
* mass mode: add an option to keep archives when doing mass sms. This mode
is actually a _message_sms in batch using the note subtype to speedup the
process;
* improve _message_sms_schedule_mass to allow more fine-tuning of options
when calling it;
* do not block sending SMS in batch if some recipients are invalid. Indeed
using notifications there will be traces of failed SMS;
* avoid reload of form view;
Linked to task 1925950 and 1935280
Part of PR #34864
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'`
It allows notably to check and test mail failure widgets as well as wizards
to resend and/or cancel sms notifications.
Related to task 1922163
Linked to PR #33510
Purpose of this commit is to allow users to have a feedback on SMS
notifications status in chatter. This commit contains notably
* an update of systray widget that now handles SMS failures. Those are
displayed in another item of the systray and redirect to documents having
an SMS failure;
* an update of chatter widgets to support SMS notifications in messages.
Failed notifications appear in red and allow to use the SMS resend
wizard;
Mail message model gains a new has_sms_error computed and searchable field
allowing to filter on messages having failed SMS notifications. Mail thread
model gains a new message_has_sms_error computed and searchable field, based
on the one on mail.message. It allows to filter on records with failed SMS
messages directly from the systray. That way clicking on the systray entry
redirects to the right records.
Related to task 1922163
Linked to PR #33510
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Co-Authored-By: Pierre Rousseau <pro@odoo.com>
Purpose of this commit is to allow SMS notification management. It is based
on what has been done in mail for notification: resend and cancel.
In this commit we add wizards allowing users to resend and cancel failed
SMS notifications. Resend allow to change the contact number, as well as
resending only a subset of notifications.
Future commits will improve the UX itself.
Related to task 1922163
Linked to PR #33510
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Co-Authored-By: Pierre Rousseau <pro@odoo.com>
Purpose of this commit is to provide users templates to use when sending
SMS. It is inspired from what already exists for mail templates. This commit
* adds templates for SMS
* users can now create template for SMS Text messages similar to mail
templates;
* jinja syntax is supported for body like mail templates, which is why
templates are linked to a given model;
* refactor the SMS composer
* templates are supported in composer like the message composer. This is
supported only in mass mode to avoid bloating the interface in standard
composition mode;
* composer code is rewritten to support various use cases (comment, mass
sms, numbers, ...) and better fits all use cases;
* composer is extended to support notably mass SMS without posting messages;
Templates will also be used in a near future in mass sms sending (mass
mailing application improvement) and in marketing automation (for enterprise).
Tests are updated and added to ensure feature works.
Related to task 1922163
Linked to PR #33510
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Co-Authored-By: Pierre Rousseau <pro@odoo.com>
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 be27955136: performance and notification code improvements
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Co-Authored-By: Pierre Rousseau <pro@odoo.com>