Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1576 Visualizzazioni

Using Settings > General Settings > Contacts > Manage SMS & Buy Credits


we have successfully registered our SMS account and have some free credits to evaluate the service (then we would purchase SMS credits package using IAP).

Using the Odoo Graphical Interface, we can successfully send a SMS to an Employee by clicking on the SMS icon​ near the Employee's mobile number.


However we need to send SMS using python in our custom Odoo module. We have installed the SMS Gateway Module (module technical name sms​), and added same in the manifest depends list.


'depends':['sms', ...],

Here is the python code to send an SMS

sms_values = {

    'body': "Have a nice day",

    'number': '+42',

}

sms = env['sms.sms'].create(sms_values)

sms._send()


Et voilà !



Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
set 25
237
1
giu 25
1490
3
mar 25
2549
2
feb 25
6434
1
feb 25
2369