diff --git a/website_hotjar/README.rst b/website_hotjar/README.rst new file mode 100644 index 000000000..bf072a3ba --- /dev/null +++ b/website_hotjar/README.rst @@ -0,0 +1,43 @@ +Hotjar Analytics +================ + +Hotjar Analytics & Feedback for Odoo website + +Depends +======= +[Website] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: fasluca, faslu@cybrosys.in + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/website_hotjar/__init__.py b/website_hotjar/__init__.py new file mode 100644 index 000000000..fa7ea9f7f --- /dev/null +++ b/website_hotjar/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import models + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/website_hotjar/__manifest__.py b/website_hotjar/__manifest__.py new file mode 100644 index 000000000..fcafc7148 --- /dev/null +++ b/website_hotjar/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Fasluca() +# you can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Hotjar Analytics', + 'version': '11.0.1.0.0', + 'summary': """Hotjar Analytics & Feedback for Odoo website""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Website', + 'depends': ['website'], + 'data': [ + 'views/res_config_settings_views.xml', + 'views/website_templates.xml' + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/website_hotjar/models/__init__.py b/website_hotjar/models/__init__.py new file mode 100644 index 000000000..3334af8e0 --- /dev/null +++ b/website_hotjar/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import website +from . import res_config_settings diff --git a/website_hotjar/models/res_config_settings.py b/website_hotjar/models/res_config_settings.py new file mode 100644 index 000000000..05056e65e --- /dev/null +++ b/website_hotjar/models/res_config_settings.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +from ast import literal_eval + +from odoo import api, fields, models +from odoo.exceptions import AccessDenied + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + has_hotjar_analytics = fields.Boolean("Hotjar Analytics") + hotjar_analytics_script = fields.Text('Hotjar Analytics Script', related='website_id.hotjar_analytics_script') + + @api.onchange('has_hotjar_analytics') + def onchange_has_hotjar_analytics(self): + if not self.has_hotjar_analytics: + self.hotjar_analytics_script = False + + @api.model + def get_values(self): + res = super(ResConfigSettings, self).get_values() + get_param = self.env['ir.config_parameter'].sudo().get_param + res.update( + has_hotjar_analytics=get_param('website.has_hotjar_analytics'), + ) + return res + + def set_values(self): + if not self.user_has_groups('website.group_website_designer'): + raise AccessDenied() + super(ResConfigSettings, self).set_values() + set_param = self.env['ir.config_parameter'].sudo().set_param + set_param('website.has_hotjar_analytics', self.has_hotjar_analytics) diff --git a/website_hotjar/models/website.py b/website_hotjar/models/website.py new file mode 100644 index 000000000..7a9f1335d --- /dev/null +++ b/website_hotjar/models/website.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +from odoo import api, fields, models + + +class Website(models.Model): + _inherit = "website" + + hotjar_analytics_script = fields.Text('Hotjar Analytics Script') diff --git a/website_hotjar/static/description/banner.jpg b/website_hotjar/static/description/banner.jpg new file mode 100644 index 000000000..4fa34749a Binary files /dev/null and b/website_hotjar/static/description/banner.jpg differ diff --git a/website_hotjar/static/description/cybro_logo.png b/website_hotjar/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/website_hotjar/static/description/cybro_logo.png differ diff --git a/website_hotjar/static/description/icon.png b/website_hotjar/static/description/icon.png new file mode 100644 index 000000000..307e45cae Binary files /dev/null and b/website_hotjar/static/description/icon.png differ diff --git a/website_hotjar/static/description/index.html b/website_hotjar/static/description/index.html new file mode 100644 index 000000000..0d34403c2 --- /dev/null +++ b/website_hotjar/static/description/index.html @@ -0,0 +1,76 @@ +
+

Hotjar Analytics

+

Cybrosys Technologies

+
+ +
+
+

Hotjar Analytics & Feedback for Odoo website

+
Step-1:Get Your Tracking Code from Hotjar
+
+
+ +
+
+
+
+ +
+
+
Step-2:Add Tracking Code to Website Settings
+
+
+ +
+
+
+
+ +
+
+
Step-3:Verify Installation
+
+
+ +
+
+
+
+ +
+
+
Step-4:Enjoy Tracking in Hotjar
+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
+ diff --git a/website_hotjar/static/description/tracking.gif b/website_hotjar/static/description/tracking.gif new file mode 100644 index 000000000..161499f56 Binary files /dev/null and b/website_hotjar/static/description/tracking.gif differ diff --git a/website_hotjar/static/description/tracking_code.png b/website_hotjar/static/description/tracking_code.png new file mode 100644 index 000000000..e8a38b777 Binary files /dev/null and b/website_hotjar/static/description/tracking_code.png differ diff --git a/website_hotjar/static/description/verify_installation.png b/website_hotjar/static/description/verify_installation.png new file mode 100644 index 000000000..c170865e3 Binary files /dev/null and b/website_hotjar/static/description/verify_installation.png differ diff --git a/website_hotjar/static/description/website_settings.png b/website_hotjar/static/description/website_settings.png new file mode 100644 index 000000000..da7a84b35 Binary files /dev/null and b/website_hotjar/static/description/website_settings.png differ diff --git a/website_hotjar/views/res_config_settings_views.xml b/website_hotjar/views/res_config_settings_views.xml new file mode 100644 index 000000000..18f61255f --- /dev/null +++ b/website_hotjar/views/res_config_settings_views.xml @@ -0,0 +1,36 @@ + + + + res.config.settings.view.form.inherit.website + res.config.settings + + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/website_hotjar/views/website_templates.xml b/website_hotjar/views/website_templates.xml new file mode 100644 index 000000000..75c0838a5 --- /dev/null +++ b/website_hotjar/views/website_templates.xml @@ -0,0 +1,10 @@ + + + +