Browse Source

May 08 : [ADD] Initial Commit 'multi_sms_gateway'

dependabot/npm_and_yarn/odoo_website_helpdesk/static/src/cdn/minimist-1.2.8
Sayooj 2 years ago
parent
commit
3a348be3d3
  1. 53
      multi_sms_gateway/README.rst
  2. 24
      multi_sms_gateway/__init__.py
  3. 56
      multi_sms_gateway/__manifest__.py
  4. 22
      multi_sms_gateway/data/sms_gateway_data.xml
  5. 7
      multi_sms_gateway/doc/RELEASE_NOTES.md
  6. 27
      multi_sms_gateway/models/__init__.py
  7. 53
      multi_sms_gateway/models/res_partner.py
  8. 42
      multi_sms_gateway/models/sms_connection_params.py
  9. 35
      multi_sms_gateway/models/sms_gateway.py
  10. 65
      multi_sms_gateway/models/sms_gateway_config.py
  11. 46
      multi_sms_gateway/models/sms_history.py
  12. 6
      multi_sms_gateway/security/ir.model.access.csv
  13. 16
      multi_sms_gateway/security/multi_sms_gateway_groups.xml
  14. 9
      multi_sms_gateway/security/sms_history_security.xml
  15. BIN
      multi_sms_gateway/static/description/assets/icons/check.png
  16. BIN
      multi_sms_gateway/static/description/assets/icons/chevron.png
  17. BIN
      multi_sms_gateway/static/description/assets/icons/cogs.png
  18. BIN
      multi_sms_gateway/static/description/assets/icons/consultation.png
  19. BIN
      multi_sms_gateway/static/description/assets/icons/ecom-black.png
  20. BIN
      multi_sms_gateway/static/description/assets/icons/education-black.png
  21. BIN
      multi_sms_gateway/static/description/assets/icons/hotel-black.png
  22. BIN
      multi_sms_gateway/static/description/assets/icons/license.png
  23. BIN
      multi_sms_gateway/static/description/assets/icons/lifebuoy.png
  24. BIN
      multi_sms_gateway/static/description/assets/icons/manufacturing-black.png
  25. BIN
      multi_sms_gateway/static/description/assets/icons/pos-black.png
  26. BIN
      multi_sms_gateway/static/description/assets/icons/puzzle.png
  27. BIN
      multi_sms_gateway/static/description/assets/icons/restaurant-black.png
  28. BIN
      multi_sms_gateway/static/description/assets/icons/service-black.png
  29. BIN
      multi_sms_gateway/static/description/assets/icons/trading-black.png
  30. BIN
      multi_sms_gateway/static/description/assets/icons/training.png
  31. BIN
      multi_sms_gateway/static/description/assets/icons/update.png
  32. BIN
      multi_sms_gateway/static/description/assets/icons/user.png
  33. BIN
      multi_sms_gateway/static/description/assets/icons/wrench.png
  34. BIN
      multi_sms_gateway/static/description/assets/misc/categories.png
  35. BIN
      multi_sms_gateway/static/description/assets/misc/check-box.png
  36. BIN
      multi_sms_gateway/static/description/assets/misc/compass.png
  37. BIN
      multi_sms_gateway/static/description/assets/misc/corporate.png
  38. BIN
      multi_sms_gateway/static/description/assets/misc/customer-support.png
  39. BIN
      multi_sms_gateway/static/description/assets/misc/cybrosys-logo.png
  40. BIN
      multi_sms_gateway/static/description/assets/misc/features.png
  41. BIN
      multi_sms_gateway/static/description/assets/misc/logo.png
  42. BIN
      multi_sms_gateway/static/description/assets/misc/pictures.png
  43. BIN
      multi_sms_gateway/static/description/assets/misc/pie-chart.png
  44. BIN
      multi_sms_gateway/static/description/assets/misc/right-arrow.png
  45. BIN
      multi_sms_gateway/static/description/assets/misc/star.png
  46. BIN
      multi_sms_gateway/static/description/assets/misc/support.png
  47. BIN
      multi_sms_gateway/static/description/assets/misc/whatsapp.png
  48. BIN
      multi_sms_gateway/static/description/assets/modules/1.png
  49. BIN
      multi_sms_gateway/static/description/assets/modules/2.png
  50. BIN
      multi_sms_gateway/static/description/assets/modules/3.png
  51. BIN
      multi_sms_gateway/static/description/assets/modules/4.gif
  52. BIN
      multi_sms_gateway/static/description/assets/modules/5.png
  53. BIN
      multi_sms_gateway/static/description/assets/modules/6.png
  54. BIN
      multi_sms_gateway/static/description/assets/screenshots/1.png
  55. BIN
      multi_sms_gateway/static/description/assets/screenshots/2.png
  56. BIN
      multi_sms_gateway/static/description/assets/screenshots/3.png
  57. BIN
      multi_sms_gateway/static/description/assets/screenshots/4.png
  58. BIN
      multi_sms_gateway/static/description/assets/screenshots/5.png
  59. BIN
      multi_sms_gateway/static/description/assets/screenshots/6.png
  60. BIN
      multi_sms_gateway/static/description/assets/screenshots/7.png
  61. BIN
      multi_sms_gateway/static/description/assets/screenshots/8.png
  62. BIN
      multi_sms_gateway/static/description/assets/screenshots/hero.gif
  63. BIN
      multi_sms_gateway/static/description/banner.png
  64. BIN
      multi_sms_gateway/static/description/icon.png
  65. 553
      multi_sms_gateway/static/description/index.html
  66. 16
      multi_sms_gateway/views/multi_sms_gateway_menus.xml
  67. 13
      multi_sms_gateway/views/res_partner_views.xml
  68. 114
      multi_sms_gateway/views/sms_gateway_config_views.xml
  69. 47
      multi_sms_gateway/views/sms_history_views.xml
  70. 23
      multi_sms_gateway/wizard/__init__.py
  71. 132
      multi_sms_gateway/wizard/send_sms.py
  72. 31
      multi_sms_gateway/wizard/send_sms_views.xml

53
multi_sms_gateway/README.rst

@ -0,0 +1,53 @@
.. image:: https://img.shields.io/badge/licence-OPL--1-red.svg
:target: https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps
:alt: License: OPL-1
Multiple SMS Gateway Integration
================================
* Module for sending SMS through different SMS gateways.
Installation
============
- www.odoo.com/documentation/16.0/setup/install.html
- Install all external dependencies
- Install our custom addon
Configuration
=============
- Add the users to the new security group 'Multiple SMS Gateway Integration / Manager' to give access to
the new menus of Multiple SMS Gateway Integration module.
- Setup the gateways that you would like to use by adding the required credentials.
License
-------
Odoo Proprietary License v1.0 (OPL-1)
(https://www.odoo.com/documentation/16.0/legal/licenses.html)
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer: (V16) Sumith S @cybrosys, Contact: odoo@cybrosys.com
Contacts
--------
* Mail Contact : odoo@cybrosys.com
Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com
Further information
===================
HTML Description: `<static/description/index.html>`__

24
multi_sms_gateway/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from . import models
from . import wizard

56
multi_sms_gateway/__manifest__.py

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
{
'name': 'Multiple SMS Gateway Integration',
'version': '16.0.1.0.0',
'category': 'Extra Tools',
'summary': 'Module to send SMS through different SMS gateway',
'description': """
This modules helps to send SMS using different SMS gateways including
D7, Twilio, Vonage, TeleSign, MessageBird and Telnyx""",
'author': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'external_dependencies': {
'python': ['messagebird', 'telesign', 'telnyx', 'twilio', 'vonage']},
'depends': ['base', 'contacts'],
'images': ['static/description/banner.png'],
'data': [
'security/multi_sms_gateway_groups.xml',
'security/sms_history_security.xml',
'security/ir.model.access.csv',
'data/sms_gateway_data.xml',
'views/sms_history_views.xml',
'views/sms_gateway_config_views.xml',
'views/res_partner_views.xml',
'wizard/send_sms_views.xml',
'views/multi_sms_gateway_menus.xml'
],
'license': 'OPL-1',
# 'price': 4.99, # ToDo: Please update the price before publish
# 'currency': 'EUR',
'installable': True,
'auto_install': False,
'application': False
}

22
multi_sms_gateway/data/sms_gateway_data.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Records for SMS Gateway -->
<record id="sms_gateway_d7" model="sms.gateway">
<field name="name">d7</field>
</record>
<record id="sms_gateway_twilio" model="sms.gateway">
<field name="name">twilio</field>
</record>
<record id="sms_gateway_vonage" model="sms.gateway">
<field name="name">vonage</field>
</record>
<record id="sms_gateway_telesign" model="sms.gateway">
<field name="name">telesign</field>
</record>
<record id="sms_gateway_messagebird" model="sms.gateway">
<field name="name">messagebird</field>
</record>
<record id="sms_gateway_telnyx" model="sms.gateway">
<field name="name">telnyx</field>
</record>
</odoo>

7
multi_sms_gateway/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <multi_sms_gateway>
#### 30.04.2023
#### Version 16.0.1.0.0
#### ADD
- Initial commit for Multiple SMS Gateway Integration

27
multi_sms_gateway/models/__init__.py

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from . import res_partner
from . import sms_connection_params
from . import sms_gateway
from . import sms_gateway_config
from . import sms_history

53
multi_sms_gateway/models/res_partner.py

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to send sms from the form view of partner. """
from odoo import models, _
class ResPartner(models.Model):
"""
Inheriting model 'res.partner' to add the function to send SMS.
Methods:
send_sms():
Opens the Send SMS wizard.
"""
_inherit = 'res.partner'
def send_sms(self):
"""
Function to open Send SMS wizard.
Returns:
dict: the action window of 'send.sms'.
"""
record_ids = self.env.context.get('active_ids')
numbers = self.env['res.partner'].browse(record_ids).mapped('phone')
return {
'name': _('Send SMS'),
'type': 'ir.actions.act_window',
'res_model': 'send.sms',
'context': {
'default_sms_to': ','.join([str(numb) for numb in numbers]),
},
'view_mode': 'form',
'target': 'new'
}

42
multi_sms_gateway/models/sms_connection_params.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to Connect SMS gateway. """
from odoo import fields, models
class SmsConnectionParams(models.Model):
"""
Class to add the credentials for establishing the connection with the
gateways.
"""
_name = 'sms.connection.params'
_description = 'SMS Connection'
name = fields.Char(string='Name', help='Name for the parameter.')
sms_gateway_config_id = fields.Many2one(
'sms.gateway.config', string='Connection ID',
help='Gateway configuration with credentials.')
connection_api = fields.Char(
string='API Method', help='Enter the API method.')
connection_value = fields.Char(
string='Value', help='Connection value for the gateway.')

35
multi_sms_gateway/models/sms_gateway.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to add gateway providers. """
from odoo import fields, models
class SmsGateway(models.Model):
"""
Class to add the gateway providers.
"""
_name = 'sms.gateway'
_description = 'SMS Gateway'
name = fields.Char(string='Provider Name',
help='Provide the name of the provider.')

65
multi_sms_gateway/models/sms_gateway_config.py

@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to configure different SMS gateway. """
from odoo import fields, models
class SmsGatewayConfig(models.Model):
"""
Class to save the user credential details for the SMS gateways.
"""
_name = 'sms.gateway.config'
_description = 'SMS Gateway Configuration'
_rec_name = 'gateway_name'
api_method = fields.Char(
string='API Method', help='The API method that has to be used.')
url = fields.Char(
sring='Gateway URL', help='Gateway URL to send the message.')
connection_ids = fields.One2many(
'sms.connection.params', 'sms_gateway_config_id', string='Parameters',
help='Connection parameters for the SMS gateway.')
sms_gateway_id = fields.Many2one(
'sms.gateway', string='Gateway', help='The SMS Gateway.')
gateway_name = fields.Char(
related='sms_gateway_id.name', help='Gateway Name')
vonage_key = fields.Char(string='Key', help='The key for Vonage')
vonage_secret = fields.Char(string='Secret', help='The secret for Vonage.')
twilio_account_sid = fields.Char(
string='Account SID', help='Account SID for Twilio.')
twilio_auth_token = fields.Char(
string='Auth Token', help='Auth token for Twilio.')
twilio_phone_number = fields.Char(
string='Twilio Number', help='Twilio phone number.')
d7_username = fields.Char(string='Username', help='D7 username.')
d7_password = fields.Char(string='Password', help=' D7 password.')
d7_from = fields.Char(string='From', help='D7 from phone number.')
telesign_customer = fields.Char(
string='TeleSign Customer ID', help='Customer ID for TeleSign.')
telesign_api_key = fields.Char(
string='TeleSign API Key', help='API key for TeleSign')
telnyx_number = fields.Char(string='Telnyx Number', help='Telnyx number.')
telnyx_api_key = fields.Char(
string='Telnyx API Key', help='API key for Telnyx.')
messagebird_api_key = fields.Char(
string='MessageBird API Key', help='API key for MessageBird.')

46
multi_sms_gateway/models/sms_history.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to see the history of all SMS send. """
from odoo import fields, models
class SmsHistory(models.Model):
"""
This model stores the details of all the SMS messages that have been
sent, including the gateway name, date of sending, mobile phone number,
and SMS text.
"""
_name = 'sms.history'
_description = 'SMS History'
_rec_name = 'sms_mobile'
sms_gateway_id = fields.Many2one('sms.gateway', string='Gateway',
help='The SMS Gateway.')
sms_date = fields.Datetime(string='Date', default=fields.Date().today(),
help='Date of sending message(current day).')
sms_mobile = fields.Char(
string='Mobile Number', help='Phone Number to send SMS.')
sms_text = fields.Text(string='SMS Text', help='The message to be sent.')
company_id = fields.Many2one(
'res.company', string='Company', required=True,
default=lambda self: self.env.company, help='Active company.')

6
multi_sms_gateway/security/ir.model.access.csv

@ -0,0 +1,6 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sms_gateway_config_manager,access.sms.gateway.config.manager,model_sms_gateway_config,multi_sms_gateway.multi_sms_gateway_group_manager,1,1,1,1
access_sms_connection_params_manager,access.sms.connection.params.manager,model_sms_connection_params,multi_sms_gateway.multi_sms_gateway_group_manager,1,1,1,1
access_send_sms_manager,access.send.sms.manager,model_send_sms,multi_sms_gateway.multi_sms_gateway_group_manager,1,1,1,1
access_sms_gateway_manager,access.sms.gateway.manager,model_sms_gateway,multi_sms_gateway.multi_sms_gateway_group_manager,1,1,1,1
access_sms_history_manager,access.sms.history.manager,model_sms_history,multi_sms_gateway.multi_sms_gateway_group_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sms_gateway_config_manager access.sms.gateway.config.manager model_sms_gateway_config multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
3 access_sms_connection_params_manager access.sms.connection.params.manager model_sms_connection_params multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
4 access_send_sms_manager access.send.sms.manager model_send_sms multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
5 access_sms_gateway_manager access.sms.gateway.manager model_sms_gateway multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
6 access_sms_history_manager access.sms.history.manager model_sms_history multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1

16
multi_sms_gateway/security/multi_sms_gateway_groups.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Module category for the module to add the security groups -->
<record id="module_category_send_sms" model="ir.module.category" >
<field name="name">Multiple SMS Gateway Integration</field>
<field name="description">Manage user access for Multiple SMS Gateway Integration module</field>
<field name="sequence">20</field>
</record>
<record id="multi_sms_gateway_group_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_category_send_sms"/>
<field name="comment">Access to the new menus and records of Multiple SMS Gateway Integration</field>
</record>
</odoo>

9
multi_sms_gateway/security/sms_history_security.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Multi-Company rule for SMS History -->
<record id="sms_history_rule_company" model="ir.rule" >
<field name="name">SMS History: Multi-company</field>
<field name="model_id" ref="model_sms_history"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
</record>
</odoo>

BIN
multi_sms_gateway/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
multi_sms_gateway/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
multi_sms_gateway/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
multi_sms_gateway/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
multi_sms_gateway/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
multi_sms_gateway/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
multi_sms_gateway/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
multi_sms_gateway/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
multi_sms_gateway/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_sms_gateway/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
multi_sms_gateway/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
multi_sms_gateway/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
multi_sms_gateway/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
multi_sms_gateway/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
multi_sms_gateway/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
multi_sms_gateway/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
multi_sms_gateway/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_sms_gateway/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
multi_sms_gateway/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
multi_sms_gateway/static/description/assets/misc/categories.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
multi_sms_gateway/static/description/assets/misc/check-box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
multi_sms_gateway/static/description/assets/misc/compass.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
multi_sms_gateway/static/description/assets/misc/corporate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
multi_sms_gateway/static/description/assets/misc/customer-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
multi_sms_gateway/static/description/assets/misc/cybrosys-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
multi_sms_gateway/static/description/assets/misc/features.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
multi_sms_gateway/static/description/assets/misc/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
multi_sms_gateway/static/description/assets/misc/pictures.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
multi_sms_gateway/static/description/assets/misc/pie-chart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
multi_sms_gateway/static/description/assets/misc/right-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

BIN
multi_sms_gateway/static/description/assets/misc/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
multi_sms_gateway/static/description/assets/misc/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
multi_sms_gateway/static/description/assets/misc/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
multi_sms_gateway/static/description/assets/modules/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
multi_sms_gateway/static/description/assets/modules/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
multi_sms_gateway/static/description/assets/modules/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
multi_sms_gateway/static/description/assets/modules/4.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
multi_sms_gateway/static/description/assets/modules/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
multi_sms_gateway/static/description/assets/modules/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
multi_sms_gateway/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
multi_sms_gateway/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
multi_sms_gateway/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

553
multi_sms_gateway/static/description/index.html

@ -0,0 +1,553 @@
<div style="background-color: #714B67; height: 810px; width: 100%; padding: 15px; position: relative;">
<!-- TITLE BAR -->
<div class="d-flex align-items-center justify-content-between" style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;"/>
<div>
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Community
</div>
<div style="color: #875A7B; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
<div style="color: #017E84; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Odoo.sh
</div>
</div>
</div>
<!-- END OF TITLE BAR -->
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<!-- APP HERO -->
<h1 style="color: #FFFFFF; font-weight: bolder; font-size: 50px; text-align: center; margin-top: 50px;">
Multiple SMS Gateway Integration
</h1>
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;">
This Module Helps To Send SMS through different SMS Gateways
</p>
<img src="assets/screenshots/hero.gif" class="img-responsive" style="width: 100%; margin-left: auto; margin-right: auto;"/>
<!-- END OF APP HERO -->
</div>
</div>
</div>
</div>
<!-- NAVIGATION SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/compass.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Explore This Module
</h2>
</div>
<div class="row my-4" style="font-family: 'Montserrat', sans-serif;">
<div class="col-sm-12 col-md-6 my-3">
<a href="#overview">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Overview</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">
Learn more about this module
</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#features">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Features</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">
View features of this module
</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#screenshots">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Screenshots</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">
View screenshots for this module
</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
</div>
<!-- END OF NAVIGATION SECTION -->
<!-- OVERVIEW SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pie-chart.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Overview
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 py-4">
This module helps to sent SMS to the customer with the help of
different SMS Gateways. The module mainly uses the Gateways
D7, Twilio, Vonage, TeleSign, MessageBird and Telnyx.
</div>
</div>
<!-- END OF OVERVIEW SECTION -->
<!-- FEATURES SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/features.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Features
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-start" style="margin-top: 40px; margin-bottom: 40px">
<img src="/assets/misc/check-box.png" class="mr-2"/>
<div>
<span style="display: block; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Send SMS through different Gateway.
</span>
<span style="display: block; font-family: 'Montserrat', sans-serif; font-size: 12px;"> </span>
</div>
</div>
<div class="d-flex align-items-start" style="margin-top: 30px; margin-bottom: 30px">
<img src="/assets/misc/check-box.png" class="mr-2"/>
<div>
<span style="display: block; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Can see all the SMS history send through the Gateway
</span>
<span style="display: block; font-family: 'Montserrat', sans-serif; font-size: 14px;"> </span>
</div>
</div>
</div>
</div>
<!-- END OF FEATURES SECTION -->
<!-- SCREENSHOTS SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="screenshots">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pictures.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Screenshots
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Select the access right for the Multiple SMS Gateway Integration module as Manager.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">
We can give the access for the module from the field.
</p>
<img src="./assets/screenshots/1.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Select the gateway to send the SMS.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">
Select the suitable gateway to send SMS.
</p>
<img src="./assets/screenshots/2.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
The credential fields will be changed depending on the gateway.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/3.png" class="img-thumbnail">
</div>
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
You can select the already created gateways.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/4.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Server action to send the SMS.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/5.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
The wizard view helps to select the gateways that you have created.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/6.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
Add the number for sending the SMS.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/7.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">
View the SMS History.
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;"></p>
<img src="./assets/screenshots/8.png" class="img-thumbnail">
</div>
</div>
<!-- END OF SCREENSHOTS SECTION -->
<!-- RELATED PRODUCTS -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/categories.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Related Products
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner" style="padding: 30px;">
<div class="carousel-item" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/custom_list_view/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/list_view_sticky_header/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/login_user_detail/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item active" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/auto_database_backup/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/one2many_mass_select_delete/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/digital_signature/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/6.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev" style="width:35px; color:#000"> <span
class="carousel-control-prev-icon"><i class="fa fa-chevron-left" style="font-size:24px"></i></span>
</a> <a class="carousel-control-next" href="#demo1" data-slide="next" style="width:35px; color:#000">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right" style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF RELATED PRODUCTS -->
<!-- OUR SERVICES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="/assets/misc/star.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Our Services
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Customization
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Implementation
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Support
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire Odoo Developer
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Integration
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Migration
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Consultancy
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Implementation
</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3" style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo Licensing Consultancy
</h6>
</div>
</div>
</div>
<!-- END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="/assets/misc/corporate.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Our Industries
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure and sell your products
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy configuration and convivial experience
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for educational management
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and schedule your operations
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile friendly, awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of services and invoice
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or restaurant methodically
</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center" style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An all-inclusive hotel management application</p>
</div>
</div>
</div>
</div>
<!-- END OF OUR INDUSTRIES -->
<!-- SUPPORT -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2" style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="/assets/misc/customer-support.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Support
</h2>
</div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4" style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="/assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;"/>
</div>
<div>
<h4>Need Help?</h4>
<p style="line-height: 100%;">
Got questions or need help? Get in touch.
</p>
<a href="mailto:odoo@cybrosys.com">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
odoo@cybrosys.com
</p>
</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4" style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="/assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;"/>
</div>
<div>
<h4>WhatsApp</h4>
<p style="line-height: 100%;">Say hi to us on WhatsApp!</p>
<a href="https://api.whatsapp.com/send?phone=918606827707">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
+91 86068 27707
</p>
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="/assets/misc/logo.png" width="144" height="31" style="width:144px; height: 31px; margin-top: 40px;"/>
</div>
</div>
</div>
<!-- END OF SUPPORT -->

16
multi_sms_gateway/views/multi_sms_gateway_menus.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Root Menu -->
<menuitem name="SMS Gateway" id="send_sms_menu_root" parent="base.menu_administration"
groups="multi_sms_gateway.multi_sms_gateway_group_manager" />
<!-- Menu to access SMS Gateways -->
<menuitem name="Gateway List" id="sms_gateway_config_menu_action"
parent="multi_sms_gateway.send_sms_menu_root"
action="multi_sms_gateway.sms_gateway_config_action"
groups="multi_sms_gateway.multi_sms_gateway_group_manager" />
<!-- Menu to access SMS History -->
<menuitem name="SMS History" id="sms_history_menu_action"
parent="multi_sms_gateway.send_sms_menu_root"
action="multi_sms_gateway.sms_history_action"
groups="multi_sms_gateway.multi_sms_gateway_group_manager" />
</odoo>

13
multi_sms_gateway/views/res_partner_views.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Server action in 'res.partner' to open the wizard to send the SMS. -->
<!-- Available in Form and Tree Views -->
<record id="action_send_sms" model="ir.actions.server">
<field name="name">Send SMS</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="binding_view_types">form,list</field>
<field name="state">code</field>
<field name="code">action = records.send_sms()</field>
</record>
</odoo>

114
multi_sms_gateway/views/sms_gateway_config_views.xml

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Form view for SMS Gateway Configuration -->
<record id="sms_gateway_config_view_form" model="ir.ui.view">
<field name="name">sms.gateway.config.view.form</field>
<field name="model">sms.gateway.config</field>
<field name="arch" type="xml">
<form string="SMS Gateway Configuration">
<sheet>
<group string="Gateway">
<field name="sms_gateway_id"/>
<field name="api_method"
attrs="{'invisible':['|','|','|','|','|',('gateway_name', '=', 'vonage'),('gateway_name', '=', 'twilio'),('gateway_name', '=', 'telesign'),('gateway_name', '=', 'd7'),('gateway_name', '=', 'messagebird'),('gateway_name', '=', 'telnyx')]}"/>
<field name="gateway_name" invisible="1"/>
<field name="url" widget="url" placeholder="e.g. https://www.odoo.com"
attrs="{'invisible':['|','|','|','|','|',('gateway_name', '=', 'vonage'),('gateway_name', '=', 'twilio'),('gateway_name', '=', 'telesign'),('gateway_name', '=', 'd7'),('gateway_name', '=', 'messagebird'),('gateway_name', '=', 'telnyx')]}"/>
</group>
<notebook>
<page string="General">
<field name="connection_ids" colspan="4" nolabel="1"
attrs="{'invisible':['|','|','|','|','|',('gateway_name', '=', 'vonage'),('gateway_name', '=', 'twilio'),('gateway_name', '=', 'telesign'),('gateway_name', '=', 'd7'),('gateway_name', '=', 'messagebird'),('gateway_name', '=', 'telnyx')]}">
<tree string="Gateway Parameters"
editable="bottom">
<field name="connection_api"/>
<field name="name"/>
<field name="connection_value"/>
</tree>
</field>
<group>
<!-- Credentials for Vonage -->
<group string="Vonage Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'vonage')]}">
<field name="vonage_key"
attrs="{'invisible':[('gateway_name', '!=', 'vonage')]}"/>
<field name="vonage_secret"
string="Secret Key"
attrs="{'invisible':[('gateway_name', '!=', 'vonage')]}"/>
</group>
<!-- Credentials for Twilio -->
<group string="Twilio Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'twilio')]}">
<field name="twilio_account_sid"
attrs="{'invisible':[('gateway_name', '!=', 'twilio')]}"/>
<field name="twilio_auth_token"
attrs="{'invisible':[('gateway_name', '!=', 'twilio')]}"/>
<field name="twilio_phone_number"
attrs="{'invisible':[('gateway_name', '!=', 'twilio')]}"/>
</group>
<!-- Credentials for Telesign -->
<group string="Telesign Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'telesign')]}">
<field name="telesign_customer"
attrs="{'invisible':[('gateway_name', '!=', 'telesign')]}"/>
<field name="telesign_api_key"
attrs="{'invisible':[('gateway_name', '!=', 'telesign')]}"/>
</group>
<!-- Credentials for d7 -->
<group string="d7 Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'd7')]}">
<field name="d7_username"
attrs="{'invisible':[('gateway_name', '!=', 'd7')]}"/>
<field name="d7_password"
attrs="{'invisible':[('gateway_name', '!=', 'd7')]}"/>
<field name="d7_from"
attrs="{'invisible':[('gateway_name', '!=', 'd7')]}"/>
</group>
<!-- Credentials for MessageBird -->
<group string="MessageBird Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'messagebird')]}">
<field name="messagebird_api_key"
attrs="{'invisible':[('gateway_name', '!=', 'messagebird')]}"/>
</group>
<!-- Credentials for Telnyx-->
<group string="telnyx Credentials"
attrs="{'invisible':[('gateway_name', '!=', 'telnyx')]}">
<field name="telnyx_number"
attrs="{'invisible':[('gateway_name', '!=', 'telnyx')]}"/>
<field name="telnyx_api_key"
attrs="{'invisible':[('gateway_name', '!=', 'telnyx')]}"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<!-- Tree view for SMS Gateway Configuration -->
<record id="sms_gateway_config_view_tree" model="ir.ui.view">
<field name="name">sms.gateway.config.view.tree</field>
<field name="model">sms.gateway.config</field>
<field name="arch" type="xml">
<tree>
<field name="gateway_name"/>
<field name="api_method"/>
<field name="url"/>
</tree>
</field>
</record>
<!-- Window action for SMS Gateway Configuration -->
<record id="sms_gateway_config_action" model="ir.actions.act_window">
<field name="name">SMS Gateway Configuration</field>
<field name="res_model">sms.gateway.config</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Gateway List Is Empty
</p>
<p>
Create a New Gateway List
</p>
</field>
</record>
</odoo>

47
multi_sms_gateway/views/sms_history_views.xml

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Form view for SMS History -->
<record id="sms_history_view_form" model="ir.ui.view">
<field name="name">sms.history.view.form</field>
<field name="model">sms.history</field>
<field name="arch" type="xml">
<form string="SMS History">
<sheet>
<group>
<group>
<field name="sms_gateway_id"/>
<field name="sms_date"/>
</group>
<group>
<field name="sms_mobile"/>
</group>
<field name="sms_text"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Tree view for SMS History -->
<record id="sms_history_view_tree" model="ir.ui.view">
<field name="name">sms.history.view.tree</field>
<field name="model">sms.history</field>
<field name="arch" type="xml">
<tree create="0">
<field name="sms_gateway_id"/>
<field name="sms_date"/>
<field name="sms_text"/>
<field name="sms_mobile"/>
</tree>
</field>
</record>
<!-- Window action for SMS History -->
<record id="sms_history_action" model="ir.actions.act_window">
<field name="name">SMS History</field>
<field name="res_model">sms.history</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
SMS history is not created yet! Please send an SMS to create new history.
</p>
</field>
</record>
</odoo>

23
multi_sms_gateway/wizard/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from . import send_sms

132
multi_sms_gateway/wizard/send_sms.py

@ -0,0 +1,132 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com)
#
# This program is under the terms of the Odoo Proprietary License v1.0
# (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
""" This module helps to add the sms details in the wizard and send SMS. """
import messagebird
import requests
import telnyx
import vonage
from telesign.messaging import MessagingClient
from twilio.rest import Client
from odoo import fields, models
from odoo.exceptions import UserError
class SendSms(models.TransientModel):
"""
Class for the wizard to send SMS.
Methods:
action_send_sms():
Button action to send SMS.
"""
_name = 'send.sms'
_description = 'Wizard to send SMS'
sms_id = fields.Many2one('sms.gateway.config', string='Connection ID',
help='Gateway record with credentials')
sms_to = fields.Char(string='Send To',
help='Enter the number to send the SMS')
text = fields.Text(string='Text', required=True,
help='Enter the text for the SMS')
def action_send_sms(self):
"""
Function to send SMS using different SMS gateway
"""
if self.sms_id.gateway_name == 'vonage':
client = vonage.Client(key=self.sms_id.vonage_key,
secret=self.sms_id.vonage_secret)
vonage.Sms(client)
for number in self.sms_to.split(','):
if number:
client.sms.send_message(
{
"from": 'Vonage APIs',
"to": number,
"text": self.text
}
)
elif self.sms_id.gateway_name == 'twilio':
client = Client(self.sms_id.twilio_account_sid,
self.sms_id.twilio_auth_token)
for number in self.sms_to.split(','):
if number:
client.messages.create(
body=self.text,
from_=self.sms_id.twilio_phone_number,
to=number
)
elif self.sms_id.gateway_name == 'telesign':
for number in self.sms_to.split(','):
if number:
messaging = MessagingClient(
self.sms_id.telesign_customer,
self.sms_id.telesign_api_key)
messaging.message(number, self.text, 'ARN')
elif self.sms_id.gateway_name == 'd7':
for number in self.sms_to.split(','):
if number:
querystring = {
"username": self.sms_id.d7_username,
"password": self.sms_id.d7_password,
"from": self.sms_id.d7_from,
"content": """This%20is%20a%20test%20message%20to%20
verify%20the%20DLR%20callback""",
"dlr-method": "POST",
"dlr-url": "https://4ba60af1.ngrok.io/receive",
"dlr": "yes",
"dlr-level": "3",
"to": number
}
requests.request(
'GET', 'https://http-api.d7networks.com/send',
headers={'cache-control': 'no-cache'},
params=querystring)
elif self.sms_id.gateway_name == 'messagebird':
client = messagebird.Client(self.sms_id.messagebird_api_key)
for number in self.sms_to.split(','):
if number:
try:
client.message_create(
'MessageBird', number, self.text,
{'reference': 'Foobar'}
)
except messagebird.client.ErrorException:
raise UserError('Invalid parameter!')
elif self.sms_id.gateway_name == 'telnyx':
telnyx.api_key = self.sms_id.telnyx_api_key
for number in self.sms_to.split(','):
if number:
try:
telnyx.Message.create(
from_=self.sms_id.telnyx_number,
to=number,
text=self.text
)
except telnyx.error.InvalidRequestError:
raise UserError('Missing required parameter!')
self.env['sms.history'].sudo().create({
'sms_gateway_id': self.sms_id.sms_gateway_id.id,
'sms_mobile': self.sms_to,
'sms_text': self.text
})

31
multi_sms_gateway/wizard/send_sms_views.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Form view for SMS User -->
<record id="send_sms_view_form" model="ir.ui.view">
<field name="name">send.sms.view.form</field>
<field name="model">send.sms</field>
<field name="arch" type="xml">
<!-- Form view of the wizard -->
<form string="Send SMS">
<group string="SMS Gateway" colspan="4">
<field name="sms_id"/>
</group>
<group string="Send SMS" colspan="4">
<field name="sms_to"/>
</group>
<notebook>
<page string="Message">
<field name="text" colspan="4" nolabel="1"/>
</page>
</notebook>
<footer>
<button string="Send SMS" name="action_send_sms"
type="object" class="oe_highlight"/>
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
</odoo>
Loading…
Cancel
Save