odoo/odoo#202992

Created by fw-bot
Merged at 85af46d0e52aeab66fc74e5250dde559875df6e7

Statuses:

label
odoo-dev:master-16.0-sms-nonthead-tde-424696-fw
head
f1ecfa1b65527492b303ac9010d61f5e922ba980
merged
6 months ago by Marketing, Thibault Delavallee (tde)
odoo/odoo
16.0 #200650
17.0 #202454
saas-17.4 #202792
18.0 #202802
saas-18.1 #202809
saas-18.2 #202913
saas-18.3
saas-18.4
19.0
master #202992

[FW][FIX] sms: compose SMS on non-thread models

Nothing prevents from creating templates and composers on non thread
models. However most necessary code relies on mail.thread.

Here we move code from mail.thread directly to BaseModel. For most
business models it does not change anything. For some side models
it allows / fixes usage of SMS composer, allowing to dynamically
find numbers / partners, ...

One notable use case that triggered this PR is sending of SMS to
users using their work phone number, or through their partner. Either
we hack user model, either we provide a generic fix.

Note that in current master (18.2+) most 'mail' generic features are
supported on non-thread models (template usage and sending, mailing
using composer, ...). SMS is still thread-specific while phone
capabilities have already been moved to generic code.

We therefore continue towards generic simple mail / sms usage on
business records, while advanced features (followers, logs, direct
post using SMS type) require thread-enabled models.

task-4113190
sentry-4681535519

Forward-Port-Of: #202913
Forward-Port-Of: #200650