Browse Source

Aug 23: [ADD] Initital Commits 'multi_sms_gateway'

pull/331/head
Cybrosys Technologies 11 months ago
parent
commit
585c2af467
  1. 54
      multi_sms_gateway/README.rst
  2. 22
      multi_sms_gateway/__init__.py
  3. 52
      multi_sms_gateway/__manifest__.py
  4. 13
      multi_sms_gateway/data/sms_gateway_data.xml
  5. 7
      multi_sms_gateway/doc/RELEASE_NOTES.md
  6. 24
      multi_sms_gateway/models/__init__.py
  7. 50
      multi_sms_gateway/models/res_partner.py
  8. 32
      multi_sms_gateway/models/sms_gateway.py
  9. 65
      multi_sms_gateway/models/sms_gateway_config.py
  10. 43
      multi_sms_gateway/models/sms_history.py
  11. 5
      multi_sms_gateway/security/ir.model.access.csv
  12. 14
      multi_sms_gateway/security/multi_sms_gateway_groups.xml
  13. 9
      multi_sms_gateway/security/sms_history_security.xml
  14. BIN
      multi_sms_gateway/static/description/assets/icons/check.png
  15. BIN
      multi_sms_gateway/static/description/assets/icons/chevron.png
  16. BIN
      multi_sms_gateway/static/description/assets/icons/cogs.png
  17. BIN
      multi_sms_gateway/static/description/assets/icons/consultation.png
  18. BIN
      multi_sms_gateway/static/description/assets/icons/ecom-black.png
  19. BIN
      multi_sms_gateway/static/description/assets/icons/education-black.png
  20. BIN
      multi_sms_gateway/static/description/assets/icons/hotel-black.png
  21. BIN
      multi_sms_gateway/static/description/assets/icons/license.png
  22. BIN
      multi_sms_gateway/static/description/assets/icons/lifebuoy.png
  23. BIN
      multi_sms_gateway/static/description/assets/icons/manufacturing-black.png
  24. BIN
      multi_sms_gateway/static/description/assets/icons/pos-black.png
  25. BIN
      multi_sms_gateway/static/description/assets/icons/puzzle.png
  26. BIN
      multi_sms_gateway/static/description/assets/icons/restaurant-black.png
  27. BIN
      multi_sms_gateway/static/description/assets/icons/service-black.png
  28. BIN
      multi_sms_gateway/static/description/assets/icons/trading-black.png
  29. BIN
      multi_sms_gateway/static/description/assets/icons/training.png
  30. BIN
      multi_sms_gateway/static/description/assets/icons/update.png
  31. BIN
      multi_sms_gateway/static/description/assets/icons/user.png
  32. BIN
      multi_sms_gateway/static/description/assets/icons/wrench.png
  33. BIN
      multi_sms_gateway/static/description/assets/misc/categories.png
  34. BIN
      multi_sms_gateway/static/description/assets/misc/check-box.png
  35. BIN
      multi_sms_gateway/static/description/assets/misc/compass.png
  36. BIN
      multi_sms_gateway/static/description/assets/misc/corporate.png
  37. BIN
      multi_sms_gateway/static/description/assets/misc/customer-support.png
  38. BIN
      multi_sms_gateway/static/description/assets/misc/cybrosys-logo.png
  39. BIN
      multi_sms_gateway/static/description/assets/misc/features.png
  40. BIN
      multi_sms_gateway/static/description/assets/misc/logo.png
  41. BIN
      multi_sms_gateway/static/description/assets/misc/pictures.png
  42. BIN
      multi_sms_gateway/static/description/assets/misc/pie-chart.png
  43. BIN
      multi_sms_gateway/static/description/assets/misc/right-arrow.png
  44. BIN
      multi_sms_gateway/static/description/assets/misc/star.png
  45. BIN
      multi_sms_gateway/static/description/assets/misc/support.png
  46. BIN
      multi_sms_gateway/static/description/assets/misc/whatsapp.png
  47. BIN
      multi_sms_gateway/static/description/assets/modules/1.jpg
  48. BIN
      multi_sms_gateway/static/description/assets/modules/2.jpg
  49. BIN
      multi_sms_gateway/static/description/assets/modules/3.png
  50. BIN
      multi_sms_gateway/static/description/assets/modules/4.png
  51. BIN
      multi_sms_gateway/static/description/assets/modules/5.jpg
  52. BIN
      multi_sms_gateway/static/description/assets/modules/6.jpg
  53. BIN
      multi_sms_gateway/static/description/assets/screenshots/hero.gif
  54. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway01.png
  55. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway1.png
  56. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway10.png
  57. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway11.png
  58. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway12.png
  59. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway13.png
  60. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway2.png
  61. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway3.png
  62. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway4.png
  63. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway5.png
  64. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway6.png
  65. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway7.png
  66. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway8.png
  67. BIN
      multi_sms_gateway/static/description/assets/screenshots/multi_sms_gateway9.png
  68. BIN
      multi_sms_gateway/static/description/banner.jpg
  69. BIN
      multi_sms_gateway/static/description/icon.png
  70. 1487
      multi_sms_gateway/static/description/index.html
  71. 16
      multi_sms_gateway/views/multi_sms_gateway_menus.xml
  72. 13
      multi_sms_gateway/views/res_partner_views.xml
  73. 74
      multi_sms_gateway/views/sms_gateway_config_views.xml
  74. 47
      multi_sms_gateway/views/sms_history_views.xml
  75. 21
      multi_sms_gateway/wizard/__init__.py
  76. 87
      multi_sms_gateway/wizard/send_sms.py
  77. 29
      multi_sms_gateway/wizard/send_sms_views.xml

54
multi_sms_gateway/README.rst

@ -0,0 +1,54 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Multiple SMS Gateway Integration
================================
* Module for sending SMS through different SMS gateways such as Twilio, Telesign, Vonage.
Installation
============
- www.odoo.com/documentation/17.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
-------
GNU Affero General Public License v3.0 (AGPL v3)
(https://www.gnu.org/licenses/agpl-3.0-standalone.html)
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer: (V16) Sumith S,
(V17) Anjana PV, 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>`__

22
multi_sms_gateway/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import models
from . import wizard

52
multi_sms_gateway/__manifest__.py

@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': 'Multiple SMS Gateway Integration',
'version': '17.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 Twilio, Vonage, TeleSign""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['base', 'contacts'],
'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'
],
'external_dependencies': {
'python': ['telesign', 'twilio', 'vonage']
},
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False
}

13
multi_sms_gateway/data/sms_gateway_data.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Records for SMS Gateway -->
<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>
</odoo>

7
multi_sms_gateway/doc/RELEASE_NOTES.md

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

24
multi_sms_gateway/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import res_partner
from . import sms_gateway
from . import sms_gateway_config
from . import sms_history

50
multi_sms_gateway/models/res_partner.py

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
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('mobile')
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'
}

32
multi_sms_gateway/models/sms_gateway.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
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) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models, _
from odoo.exceptions import UserError
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'
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.')
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')
@api.constrains('sms_gateway_id')
def _check_credentials(self):
""" Check whether all the credential field have values"""
if self.sms_gateway_id.name == 'telesign':
if not self.telesign_customer or not self.telesign_api_key:
raise UserError(
_('Provide correct credentials for Telesign'))
if self.sms_gateway_id.name == 'vonage':
if not self.vonage_key or not self.vonage_secret:
raise UserError(
_('Provide correct credentials for Vonage'))
if self.sms_gateway_id.name == 'twilio':
if (not self.twilio_phone_number or not self.twilio_auth_token
or not self.twilio_account_sid):
raise UserError(
_('Provide correct credentials for Twilio'))

43
multi_sms_gateway/models/sms_history.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
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.')

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

@ -0,0 +1,5 @@
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_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_send_sms_manager access.send.sms.manager model_send_sms multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
4 access_sms_gateway_manager access.sms.gateway.manager model_sms_gateway multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1
5 access_sms_history_manager access.sms.history.manager model_sms_history multi_sms_gateway.multi_sms_gateway_group_manager 1 1 1 1

14
multi_sms_gateway/security/multi_sms_gateway_groups.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- 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.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
multi_sms_gateway/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
multi_sms_gateway/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

1487
multi_sms_gateway/static/description/index.html

File diff suppressed because it is too large

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>

74
multi_sms_gateway/views/sms_gateway_config_views.xml

@ -0,0 +1,74 @@
<?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" options="{'no_create_edit':True}"/>
<field name="gateway_name" invisible="1"/>
</group>
<notebook>
<page string="General">
<group>
<!-- Credentials for Vonage -->
<group string="Vonage Credentials"
invisible="gateway_name != 'vonage'">
<field name="vonage_key"
invisible="gateway_name != 'vonage'"/>
<field name="vonage_secret"
string="Secret Key"
invisible="gateway_name != 'vonage'"/>
</group>
<!-- Credentials for Twilio -->
<group string="Twilio Credentials"
invisible="gateway_name != 'twilio'">
<field name="twilio_account_sid"
invisible="gateway_name != 'twilio'"/>
<field name="twilio_auth_token"
invisible="gateway_name != 'twilio'"/>
<field name="twilio_phone_number"
invisible="gateway_name != 'twilio'"/>
</group>
<!-- Credentials for Telesign -->
<group string="Telesign Credentials"
invisible="gateway_name != 'telesign'">
<field name="telesign_customer"
invisible="gateway_name != 'telesign'"/>
<field name="telesign_api_key"
invisible="gateway_name != 'telesign'"/>
</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"/>
</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>

21
multi_sms_gateway/wizard/__init__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import send_sms

87
multi_sms_gateway/wizard/send_sms.py

@ -0,0 +1,87 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
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:
try:
client.messages.create(
body=self.text,
from_=int(self.sms_id.twilio_phone_number),
to=number
)
except:
raise UserError(
_('Provide correct credentials'))
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')
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
})

29
multi_sms_gateway/wizard/send_sms_views.xml

@ -0,0 +1,29 @@
<?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