diff --git a/pos_greetings/README.rst b/pos_greetings/README.rst new file mode 100644 index 000000000..3b41d8f25 --- /dev/null +++ b/pos_greetings/README.rst @@ -0,0 +1,32 @@ + +POS Customer Greeting Messages +============================== +This module allow to send greetings to the customer. + +Depends +======= +[point_of_sale] addon Odoo + + +Installation +============ + +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developers: v13.0 YADHU K + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/pos_greetings/__init__.py b/pos_greetings/__init__.py new file mode 100644 index 000000000..e41d182fd --- /dev/null +++ b/pos_greetings/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: YADHU K (odoo@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 . +# +############################################################################# + +from . import model + + + diff --git a/pos_greetings/__manifest__.py b/pos_greetings/__manifest__.py new file mode 100644 index 000000000..bec83079d --- /dev/null +++ b/pos_greetings/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: YADHU K (odoo@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 . +# +############################################################################# +{ + 'name': 'POS Customer Greeting Messages', + 'version': '13.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Send Greeting messages to Customers in Pos Order', + 'description': 'Send Greeting messages to Customers in Pos Order', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['point_of_sale'], + 'external_dependencies': {'python': ['twilio']}, + 'data': [ + 'security/ir.model.access.csv', + 'views/pos_config_settings.xml', + 'views/pos_greetings_view.xml', + ], + 'license': 'AGPL-3', + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': False, + 'auto_install': False, + +} diff --git a/pos_greetings/doc/RELEASE_NOTES.md b/pos_greetings/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3f4ac0dc0 --- /dev/null +++ b/pos_greetings/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.04.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for pos_greetings \ No newline at end of file diff --git a/pos_greetings/model/__init__.py b/pos_greetings/model/__init__.py new file mode 100644 index 000000000..2593e536e --- /dev/null +++ b/pos_greetings/model/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: YADHU K (odoo@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 . +# +############################################################################# + +from . import pos_greetings \ No newline at end of file diff --git a/pos_greetings/model/pos_greetings.py b/pos_greetings/model/pos_greetings.py new file mode 100644 index 000000000..d4824d998 --- /dev/null +++ b/pos_greetings/model/pos_greetings.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: YADHU K (odoo@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 . +# +############################################################################# +from odoo import fields, models, api +from twilio.rest import Client + + +class POSOrderInherit(models.Model): + _inherit = 'pos.order' + + @api.model + def create_from_ui(self, orders, draft=False): + res = super(POSOrderInherit, self).create_from_ui(orders) + id = [] + for line in res: + if line['id']: + id.append(line['id']) + backend_order = self.search([('id', 'in', id)]) + if backend_order: + for pos_order in backend_order: + config_id = pos_order.session_id.config_id + if config_id.customer_msg: + if pos_order.partner_id.phone: + try: + customer_phone = str(pos_order.partner_id.phone) + twilio_number = config_id.twilio_number + auth_token = config_id.auth_token + account_sid = config_id.account_sid + body = config_id.sms_body + + # Download the helper library from https://www.twilio.com/docs/python/install + + client = Client(account_sid, auth_token) + message = client.messages.create( + body=body, + from_=twilio_number, + to=customer_phone + ) + pos_greeting_obj = self.env['pos.greetings'] + pos_greeting_obj.create({ + 'customer_id': pos_order.partner_id.id, + 'order_id': pos_order.id, + 'auth_token': auth_token, + 'twilio_number': twilio_number, + 'to_number': customer_phone, + 'session_id': pos_order.session_id.id, + 'sms_body': body, + 'send_sms': True, + }) + except: + pass + return res + + +class POSGreetings(models.Model): + _name = 'pos.greetings' + _description = 'POS Greetings' + + customer_id = fields.Many2one('res.partner', string='Customer') + order_id = fields.Many2one('pos.order', string='Order') + auth_token = fields.Char('Token') + twilio_number = fields.Char('Twilio Number') + to_number = fields.Char('Customer Number') + sms_body = fields.Char('Body', required=True) + session_id = fields.Many2one('pos.session', string='Session') + send_sms = fields.Boolean(string='Send SMS', default=False) + + +class ResConfigSettings(models.Model): + _inherit = 'pos.config' + + customer_msg = fields.Boolean('POS Greetings', Help='Create an account if you ever create an account') + auth_token = fields.Char('Auth Token', Help='Copy the token from your twilio console window adn paste here', required=True) + account_sid = fields.Char('Account SID', required=True) + twilio_number = fields.Char('Twilio Number', Help='The number provided by twilio used to send text messeges', required=True) + sms_body = fields.Text('Body', required=True) + + + diff --git a/pos_greetings/security/ir.model.access.csv b/pos_greetings/security/ir.model.access.csv new file mode 100644 index 000000000..8662a7dad --- /dev/null +++ b/pos_greetings/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_greetings,access_pos_greetings,model_pos_greetings,,1,0,1,0 \ No newline at end of file diff --git a/pos_greetings/static/description/banner.png b/pos_greetings/static/description/banner.png new file mode 100644 index 000000000..84e593291 Binary files /dev/null and b/pos_greetings/static/description/banner.png differ diff --git a/pos_greetings/static/description/icon.png b/pos_greetings/static/description/icon.png new file mode 100644 index 000000000..c323be587 Binary files /dev/null and b/pos_greetings/static/description/icon.png differ diff --git a/pos_greetings/static/description/images/checked.png b/pos_greetings/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/pos_greetings/static/description/images/checked.png differ diff --git a/pos_greetings/static/description/images/cybrosys.png b/pos_greetings/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/pos_greetings/static/description/images/cybrosys.png differ diff --git a/pos_greetings/static/description/images/image_1.png b/pos_greetings/static/description/images/image_1.png new file mode 100644 index 000000000..5cd13b958 Binary files /dev/null and b/pos_greetings/static/description/images/image_1.png differ diff --git a/pos_greetings/static/description/images/image_2.png b/pos_greetings/static/description/images/image_2.png new file mode 100644 index 000000000..b9073e224 Binary files /dev/null and b/pos_greetings/static/description/images/image_2.png differ diff --git a/pos_greetings/static/description/images/image_3.png b/pos_greetings/static/description/images/image_3.png new file mode 100644 index 000000000..035c09419 Binary files /dev/null and b/pos_greetings/static/description/images/image_3.png differ diff --git a/pos_greetings/static/description/images/pos_filter.jpeg b/pos_greetings/static/description/images/pos_filter.jpeg new file mode 100644 index 000000000..022c17a95 Binary files /dev/null and b/pos_greetings/static/description/images/pos_filter.jpeg differ diff --git a/pos_greetings/static/description/images/pos_logo.png b/pos_greetings/static/description/images/pos_logo.png new file mode 100644 index 000000000..97d6c5041 Binary files /dev/null and b/pos_greetings/static/description/images/pos_logo.png differ diff --git a/pos_greetings/static/description/images/pos_product.png b/pos_greetings/static/description/images/pos_product.png new file mode 100644 index 000000000..9f62d36ce Binary files /dev/null and b/pos_greetings/static/description/images/pos_product.png differ diff --git a/pos_greetings/static/description/images/pos_reciept.jpeg b/pos_greetings/static/description/images/pos_reciept.jpeg new file mode 100644 index 000000000..aad3880ad Binary files /dev/null and b/pos_greetings/static/description/images/pos_reciept.jpeg differ diff --git a/pos_greetings/static/description/images/pos_return.png b/pos_greetings/static/description/images/pos_return.png new file mode 100644 index 000000000..026b47e1e Binary files /dev/null and b/pos_greetings/static/description/images/pos_return.png differ diff --git a/pos_greetings/static/description/images/pos_voucher.png b/pos_greetings/static/description/images/pos_voucher.png new file mode 100644 index 000000000..cf274c0bb Binary files /dev/null and b/pos_greetings/static/description/images/pos_voucher.png differ diff --git a/pos_greetings/static/description/images/task_timer.gif b/pos_greetings/static/description/images/task_timer.gif new file mode 100644 index 000000000..ba0a1bd3d Binary files /dev/null and b/pos_greetings/static/description/images/task_timer.gif differ diff --git a/pos_greetings/static/description/index.html b/pos_greetings/static/description/index.html new file mode 100644 index 000000000..88fa21894 --- /dev/null +++ b/pos_greetings/static/description/index.html @@ -0,0 +1,294 @@ +
cybrosys-logo
+
+
+
+

POS Customer Greeting Messages

+

Send Greeting messages to Customers in Pos Order using Twilio

+
+

Key Highlights

+
    +
  • checkSend greeting to the customer by clicking 'Validate' button in POS.
  • +
  • checkIntegrated with Twilio.
  • +
  • checkConfigurable Greeting message.
  • +
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module allow to send a greeting to the POS customer after validating the POS order. You should install the Twilio python package. After this module installation you want to check with the trail account. +

+
+
+ +

POS Greetings

+
+
    +
  • + checkSend customer greetings. +
  • +
  • + checkSend greeting on POS order validation. +
  • +
  • + checkIntegrated with Twilio. +
  • +
+
+ +
+
+

Screenshots

+
+
+
+ +
+
+
+
+ + +
+
    +
+
+
+
+
+
+
+

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/pos_greetings/views/pos_config_settings.xml b/pos_greetings/views/pos_config_settings.xml new file mode 100644 index 000000000..314999f59 --- /dev/null +++ b/pos_greetings/views/pos_config_settings.xml @@ -0,0 +1,55 @@ + + + + pos.twilio.config.view.form + pos.config + + + +

POS Greetings

+
+
+
+ +
+
+
+
+
+
+
+
+ + + +
\ No newline at end of file diff --git a/pos_greetings/views/pos_greetings_view.xml b/pos_greetings/views/pos_greetings_view.xml new file mode 100644 index 000000000..3865bcb0b --- /dev/null +++ b/pos_greetings/views/pos_greetings_view.xml @@ -0,0 +1,60 @@ + + + + + view.pos.greetings.tree + pos.greetings + + + + + + + + + + + + view.pos.greetings.form + pos.greetings + +
+ + + + + + + + + + + + + + + + + + +
+
+ +
+ + + POS Greetings + pos.greetings + tree,form + +

POS Greetings +

+
+
+ + +
\ No newline at end of file