Commit Graph
193 Commits
Author SHA1 Message Date
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Martin Trigaux 73e70673e7 [I18N] *: export saas-12.5 source terms
closes odoo/odoo#36853

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-13 11:38:37 +00:00
ryv-odoo 8e2da3b4d6 [IMP] (sms_)mass_mailing: improve interface
- 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
2019-09-12 14:53:44 +00:00
ryv-odoo e4afa5d6d0 [IMP] sms: allow to create a sms context action
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
2019-09-12 14:53:44 +00:00
ryv-odoo 076e71cb5b [IMP] sms: allow to preview a sms template
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
2019-09-12 14:53:44 +00:00
ryv-odoo 8ef1543908 [FIX] sms - mass_mailing: fix some bugs
- 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
2019-09-12 14:53:44 +00:00
Martin Trigaux 68c753af55 [I18N] *: export saas-12.5 source terms
Still without demo data

closes odoo/odoo#36559

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-10 08:58:33 +00:00
Odoo Translation Bot 0d51520083 [I18N] Update translation terms from Transifex 2019-09-08 01:29:12 +02:00
Odoo Translation Bot 86809804f9 [I18N] Update translation terms from Transifex 2019-09-01 01:28:13 +02:00
Martin Trigaux b247aa3252 [I18N] *: export saas-12.5 source terms
That will be used a the basis for the future 13.0 version
Without demo data

closes odoo/odoo#36057

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 09:38:09 +00:00
Thibault Delavallée dfc8023b71 [REF] sms: make application auto install
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

closes odoo/odoo#35946

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-22 08:26:39 +00:00
Raphael Collet 8918bbbb5e [IMP] fields: do not trigger recomputations on transient models from regular models
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.

closes odoo/odoo#35909

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-22 10:05:52 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
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.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Thibault Delavallée e7cd604afa [IMP] sms: add a is_mail_thread_sms field allowing to filter models
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)
2019-08-12 12:00:22 +00:00
Thibault Delavallée 5450415354 [REF] sms: improve onboarding and user experience of SMS composer
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)
2019-08-12 12:00:22 +00:00
Thibault Delavallée 5d1f08a012 [IMP] sms: integrate duplicate / blacklist into composer in batch mode
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)
2019-08-12 12:00:22 +00:00
Thibault Delavallée 7e8a02cd6e [IMP] phone_validation: add blacklist mechanism
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)
2019-08-12 12:00:22 +00:00
Thibault Delavallée f7a17c2380 [FIX] sms: correctly take mobile or phone as valid number fields for partners
Partner / Contact model may hold valid mobile numbers in mobile or phone
fields.

LINKS

Task 1997464

closes odoo/odoo#35599

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-09 11:49:39 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00
Christophe Simonis d5e1fd16b4 [MERGE] forward port branch saas-12.4 up to cda4f3c308 2019-07-29 14:10:30 +02:00
Christophe Simonis bfd34e14b1 [MERGE] forward port branch saas-12.3 up to 40e8b67179 2019-07-26 15:12:29 +02:00
Martin Trigaux a98427834e [MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c2
closes odoo/odoo#35119

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-24 10:32:23 +00:00
Martin Trigaux e266c7c98a [MERGE] Forward port of 12.0 to saas-12.2 up to 5e4c1b3701 2019-07-23 13:41:00 +02:00
Remi Rahir 4968eb7c83 [FIX] sms: update and fix returned IAP state about badly formatted numbers
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) <tde@openerp.com>
2019-07-23 08:29:15 +00:00
Remi Rahir 17679bd44c [FIX] sms: fix some issues in SMS composer
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
2019-07-23 08:29:15 +00:00
Remi Rahir cce91e35f7 [FIX] sms: fix some issues in JS widgets
PURPOSE

Followup of merge 4287481 .

SPECIFICATIONS

Correctly reload after sending SMS;
Correctly re-render the typing widget for SMS.

LINKS

Task 1922187
2019-07-23 08:29:15 +00:00
Remi Rahir e20c1b6eff [FIX] sms: fix some typos
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
2019-07-23 08:29:15 +00:00
Thibault Delavallée 0cc6390db5 [FIX] sms: do not display popover for void notification
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
2019-07-23 08:29:15 +00:00
Odoo Translation Bot 72339a5301 [I18N] Update translation terms from Transifex 2019-07-21 01:18:28 +02:00
Odoo Translation Bot f2b1d58f9c [I18N] Update translation terms from Transifex 2019-06-30 06:15:32 +02:00
Odoo Translation Bot 57320593f7 [I18N] Update translation terms from Transifex 2019-07-07 01:19:07 +02:00
Odoo Translation Bot 48a9f5a633 [I18N] Update translation terms from Transifex 2019-06-16 06:15:35 +02:00
Martin Trigaux 52936ec260 [I18N] *: export saas-12.3 source terms
closes odoo/odoo#34068

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-12 12:39:50 +00:00
Thibault Delavallée 46f2f04b85 [FIX] sms: use right has_sms_error field on message
closes odoo/odoo#34992

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-18 14:21:35 +00:00
Thibault Delavallée 16b3bf78a0 [IMP] sms: allow to send SMS from server (and automated) actions
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
2019-07-18 09:57:47 +00:00
Thibault Delavallée f18a089ca9 [IMP] sms, calendar_sms: improve integration of SMS
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
2019-07-18 09:20:58 +00:00
Thibault Delavallée 2b7ad217f1 [FIX] mail, sms: post sms message as a note on related document and apply various fixes
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
2019-07-18 09:20:06 +00:00
Thibault Delavallée ac212ae65d [IMP] sms: improve composer behavior
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
2019-07-18 09:19:04 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
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'`
2019-07-17 14:13:12 +02:00
Thibault Delavallée 54f5c6c70f [IMP] sms: add some demo data
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
2019-07-12 14:54:11 +00:00
Thibault DelavalléeandPierre Rousseau 423cf93eb3 [IMP] sms: add UX elements to use SMS notifications
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>
2019-07-12 14:54:11 +00:00
Thibault DelavalléeandPierre Rousseau 45555bdd1f [IMP] sms: allow to resend and cancel SMS notifications
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>
2019-07-12 14:54:11 +00:00
Thibault DelavalléeandPierre Rousseau 14ccc770bb [IMP] sms: improve SMS widget
Related to task 1922163
Linked to PR #33510

Co-Authored-By: Thibault Delavallee <tde@odoo.com>
Co-Authored-By: Pierre Rousseau <pro@odoo.com>
2019-07-12 14:54:11 +00:00
Pierre RousseauandThibault Delavallee 9ad7a88a08 [IMP] sms: add SMS template and its support in SMS composer
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>
2019-07-12 14:54:11 +00:00
Thibault DelavalléeandPierre Rousseau bdebcab0ce [REF] sms: refactor message_post using SMS notifications
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>
2019-07-12 14:54:11 +00:00
Hiral Bhavsar 29bb709844 [IMP] sms: set action menu 'Send SMS' only for list view
Set action menu 'Send SMS' only for list view of 'res.partner' model.

Linked to task 1984526
Related to PR #33720
2019-07-10 15:07:56 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Odoo Translation Bot 25eac59ffa [I18N] Update translation terms from Transifex 2019-06-16 01:18:49 +02:00
Martin Trigaux 00ef2653da [MERGE] Forward port of 12.0 to saas-12.2 up to 3b1d00acda
closes odoo/odoo#34732

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 10:14:06 +00:00
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02:00