From bdebcab0cea467e070c1936fed16173247abafdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 23 May 2019 10:09:35 +0000 Subject: [REF] sms: refactor message_post using SMS notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-Authored-By: Pierre Rousseau --- addons/sms/data/ir_cron_data.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 addons/sms/data/ir_cron_data.xml (limited to 'addons/sms/data/ir_cron_data.xml') diff --git a/addons/sms/data/ir_cron_data.xml b/addons/sms/data/ir_cron_data.xml new file mode 100644 index 00000000000..e8a5d771dd5 --- /dev/null +++ b/addons/sms/data/ir_cron_data.xml @@ -0,0 +1,14 @@ + + + + SMS: SMS Queue Manager + + code + model._process_queue() + + 1 + hours + -1 + + + \ No newline at end of file -- cgit v1.2.3