diff --git a/customize_settings/README.rst b/customize_settings/README.rst new file mode 100644 index 000000000..4e0aef5d6 --- /dev/null +++ b/customize_settings/README.rst @@ -0,0 +1,54 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=============== +Odoo Debranding +=============== + +Debranding of odoo with the given configurations under Website Admin -> Debranding Configurations. +Will replace: + + - Page Title + - Login Page Modification + - User Drop down Odoo links + - POS Odoo logo replaced by company logo + - Odoo Database Selector Logo, Labels + +Installation +============ +- www.odoo.com/documentation/14.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: + V13 Atul Varma + V14 Sachin T + +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 `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/customize_settings/__init__.py b/customize_settings/__init__.py new file mode 100644 index 000000000..34e91005f --- /dev/null +++ b/customize_settings/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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 controllers +from . import models diff --git a/customize_settings/__manifest__.py b/customize_settings/__manifest__.py new file mode 100644 index 000000000..42ae18a19 --- /dev/null +++ b/customize_settings/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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': "Customize Odoo", + 'version': "14.0.1.0.0", + 'summary': """Customize Odoo, odoo14""", + 'description': """Customize Odoo, odoo14""", + 'live_test_url': 'https://www.youtube.com/watch?v=fYSPARjmYA4', + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'category': 'Tools', + 'depends': ['website', 'base_setup'], + 'data': [ + 'views/views.xml', + 'views/res_config_views.xml', + 'views/ir_module_views.xml' + ], + 'qweb': ["static/src/xml/base.xml", + "static/src/xml/res_config_edition.xml"], + 'images': ['static/description/banner.jpg'], + 'license': "LGPL-3", + 'installable': True, + 'application': False +} diff --git a/customize_settings/controllers/__init__.py b/customize_settings/controllers/__init__.py new file mode 100644 index 000000000..f99a938a9 --- /dev/null +++ b/customize_settings/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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 controllers \ No newline at end of file diff --git a/customize_settings/controllers/controllers.py b/customize_settings/controllers/controllers.py new file mode 100644 index 000000000..22e6f0cac --- /dev/null +++ b/customize_settings/controllers/controllers.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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 . +# +############################################################################# + +import base64 +import functools +import io +import json + +from odoo.http import request +from odoo.modules import get_resource_path +from odoo.tools.mimetypes import guess_mimetype + +import jinja2 +import odoo +import os +import sys +from odoo import http +from odoo.addons.web.controllers import main +from odoo.addons.web.controllers.main import Binary +from odoo.addons.web.controllers.main import Database + +if hasattr(sys, 'frozen'): + # When running on compiled windows binary, we don't have access to + # package loader. + path = os.path.realpath( + os.path.join(os.path.dirname(__file__), '..', 'views')) + loader = jinja2.FileSystemLoader(path) +else: + loader = jinja2.PackageLoader('odoo.addons.customize_settings', "views") +env = main.jinja2.Environment(loader=loader, autoescape=True) +env.filters["json"] = json.dumps +db_monodb = http.db_monodb +DBNAME_PATTERN = '^[a-zA-Z0-9][a-zA-Z0-9_.-]+$' + + +class BinaryCustom(Binary): + @http.route([ + '/web/binary/company_logo', + '/logo', + '/logo.png', + ], type='http', auth="none") + def company_logo(self, dbname=None, **kw): + imgname = 'logo' + imgext = '.png' + placeholder = functools.partial(get_resource_path, 'web', 'static', + 'src', 'img') + uid = None + if request.session.db: + dbname = request.session.db + uid = request.session.uid + elif dbname is None: + dbname = db_monodb() + + if not uid: + uid = odoo.SUPERUSER_ID + + if not dbname: + response = http.send_file(placeholder(imgname + imgext)) + else: + try: + # create an empty registry + registry = odoo.modules.registry.Registry(dbname) + with registry.cursor() as cr: + company = int(kw['company']) if kw and kw.get( + 'company') else False + if company: + cr.execute("""SELECT logo_web, write_date + FROM res_company + WHERE id = %s + """, (company,)) + else: + cr.execute("""SELECT c.logo_web, c.write_date + FROM res_users u + LEFT JOIN res_company c + ON c.id = u.company_id + WHERE u.id = %s + """, (uid,)) + row = cr.fetchone() + if row and row[0]: + image_base64 = base64.b64decode(row[0]) + image_data = io.BytesIO(image_base64) + mimetype = guess_mimetype(image_base64, + default='image/png') + imgext = '.' + mimetype.split('/')[1] + if imgext == '.svg+xml': + imgext = '.svg' + + response = http.send_file(image_data, + filename=imgname + imgext, + mimetype=mimetype, + mtime=row[1]) + else: + response = http.send_file(placeholder('nologo.png')) + except Exception: + response = http.send_file(placeholder(imgname + imgext)) + + return response + + +class OdooDebrand(Database): + + def _render_template(self, **d): + + d.setdefault('manage', True) + d['insecure'] = odoo.tools.config.verify_admin_password('admin') + d['list_db'] = odoo.tools.config['list_db'] + d['langs'] = odoo.service.db.exp_list_lang() + d['countries'] = odoo.service.db.exp_list_countries() + d['pattern'] = DBNAME_PATTERN + website_id = request.env['website'].sudo().search([]) + d['website_name'] = website_id and website_id[0].name or '' + d['company_name'] = website_id and website_id[0].company_id.name or '' + d['favicon'] = website_id and website_id[0].favicon_url or '' + d['company_logo_url'] = website_id and website_id[ + 0].company_logo_url or '' + + # databases list + d['databases'] = [] + try: + d['databases'] = http.db_list() + d['incompatible_databases'] = odoo.service.db.list_db_incompatible( + d['databases']) + except odoo.exceptions.AccessDenied: + monodb = db_monodb() + if monodb: + d['databases'] = [monodb] + return env.get_template("database_manager_extend.html").render(d) diff --git a/customize_settings/doc/RELEASE_NOTES.md b/customize_settings/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3c2895240 --- /dev/null +++ b/customize_settings/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 25.04.2021 +#### Version 14.0.1.0.0 +#### ADD +Initial Commit for customize_settings diff --git a/customize_settings/models/__init__.py b/customize_settings/models/__init__.py new file mode 100644 index 000000000..15ec51263 --- /dev/null +++ b/customize_settings/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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 models diff --git a/customize_settings/models/models.py b/customize_settings/models/models.py new file mode 100644 index 000000000..4463b5c6b --- /dev/null +++ b/customize_settings/models/models.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# +# 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 models, fields, api, tools + + +class OdooDebrand(models.Model): + """ + Fields to access from the database manager. + """ + _inherit = "website" + + def get_company_logo(self): + self.company_logo_url ="/web/image/res.company/%s/logo"%(self.id) + + def get_favicon(self): + id = self.env['website'].sudo().search([]) + self.favicon_url ="/web/image/website/%s/favicon"%(id[0].id) + + favicon_url = fields.Text("Url", compute='get_favicon') + company_logo_url = fields.Text("Url", compute='get_company_logo') diff --git a/customize_settings/static/description/banner.jpg b/customize_settings/static/description/banner.jpg new file mode 100644 index 000000000..4c45bd970 Binary files /dev/null and b/customize_settings/static/description/banner.jpg differ diff --git a/customize_settings/static/description/cybro_logo.png b/customize_settings/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/customize_settings/static/description/cybro_logo.png differ diff --git a/customize_settings/static/description/icon.png b/customize_settings/static/description/icon.png new file mode 100644 index 000000000..5b8cd1561 Binary files /dev/null and b/customize_settings/static/description/icon.png differ diff --git a/customize_settings/static/description/images/checked.png b/customize_settings/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/customize_settings/static/description/images/checked.png differ diff --git a/customize_settings/static/description/images/cybrosys.png b/customize_settings/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/customize_settings/static/description/images/cybrosys.png differ diff --git a/customize_settings/static/description/images/debranding-01.png b/customize_settings/static/description/images/debranding-01.png new file mode 100644 index 000000000..bc26f0d71 Binary files /dev/null and b/customize_settings/static/description/images/debranding-01.png differ diff --git a/customize_settings/static/description/images/debranding-02.png b/customize_settings/static/description/images/debranding-02.png new file mode 100644 index 000000000..c466467a9 Binary files /dev/null and b/customize_settings/static/description/images/debranding-02.png differ diff --git a/customize_settings/static/description/images/debranding-03.png b/customize_settings/static/description/images/debranding-03.png new file mode 100644 index 000000000..e199e3b2f Binary files /dev/null and b/customize_settings/static/description/images/debranding-03.png differ diff --git a/customize_settings/static/description/images/debranding-04.png b/customize_settings/static/description/images/debranding-04.png new file mode 100644 index 000000000..ffa4a31f0 Binary files /dev/null and b/customize_settings/static/description/images/debranding-04.png differ diff --git a/customize_settings/static/description/images/debranding-05.png b/customize_settings/static/description/images/debranding-05.png new file mode 100644 index 000000000..21ff53707 Binary files /dev/null and b/customize_settings/static/description/images/debranding-05.png differ diff --git a/customize_settings/static/description/images/debranding-06.png b/customize_settings/static/description/images/debranding-06.png new file mode 100644 index 000000000..83c08b650 Binary files /dev/null and b/customize_settings/static/description/images/debranding-06.png differ diff --git a/customize_settings/static/description/images/debranding_1.gif b/customize_settings/static/description/images/debranding_1.gif new file mode 100644 index 000000000..e113fb7a8 Binary files /dev/null and b/customize_settings/static/description/images/debranding_1.gif differ diff --git a/customize_settings/static/description/images/odoo debranding.png b/customize_settings/static/description/images/odoo debranding.png new file mode 100644 index 000000000..9b8b72f7e Binary files /dev/null and b/customize_settings/static/description/images/odoo debranding.png differ diff --git a/customize_settings/static/description/images/odoo-debrand.png b/customize_settings/static/description/images/odoo-debrand.png new file mode 100644 index 000000000..ae1c07e3d Binary files /dev/null and b/customize_settings/static/description/images/odoo-debrand.png differ diff --git a/customize_settings/static/description/images/order_types_in_pos.png b/customize_settings/static/description/images/order_types_in_pos.png new file mode 100644 index 000000000..2554ded45 Binary files /dev/null and b/customize_settings/static/description/images/order_types_in_pos.png differ diff --git a/customize_settings/static/description/images/pos_book_order.gif b/customize_settings/static/description/images/pos_book_order.gif new file mode 100644 index 000000000..935190db4 Binary files /dev/null and b/customize_settings/static/description/images/pos_book_order.gif differ diff --git a/customize_settings/static/description/images/pos_combo_products.png b/customize_settings/static/description/images/pos_combo_products.png new file mode 100644 index 000000000..98673039e Binary files /dev/null and b/customize_settings/static/description/images/pos_combo_products.png differ diff --git a/customize_settings/static/description/images/pos_lot_expiry_warning.png b/customize_settings/static/description/images/pos_lot_expiry_warning.png new file mode 100644 index 000000000..ed9d045ca Binary files /dev/null and b/customize_settings/static/description/images/pos_lot_expiry_warning.png differ diff --git a/customize_settings/static/description/images/pos_product_addons.png b/customize_settings/static/description/images/pos_product_addons.png new file mode 100644 index 000000000..25d4d79f4 Binary files /dev/null and b/customize_settings/static/description/images/pos_product_addons.png differ diff --git a/customize_settings/static/description/images/pos_return.jpeg b/customize_settings/static/description/images/pos_return.jpeg new file mode 100644 index 000000000..874a6d32a Binary files /dev/null and b/customize_settings/static/description/images/pos_return.jpeg differ diff --git a/customize_settings/static/description/images/remove_orders.png b/customize_settings/static/description/images/remove_orders.png new file mode 100644 index 000000000..8096e2708 Binary files /dev/null and b/customize_settings/static/description/images/remove_orders.png differ diff --git a/customize_settings/static/description/index.html b/customize_settings/static/description/index.html new file mode 100644 index 000000000..3ba9d300b --- /dev/null +++ b/customize_settings/static/description/index.html @@ -0,0 +1,357 @@ + +
cybrosys-logo
+ +
+
+
+

ODOO DEBRANDING

+

Debrand Odoo Back-End + Front-End .

+
+

Key Highlights

+
    +
  • Modify database selector page
  • +
  • Modify login page
  • +
  • Remove 'About' in Configuration
  • +
  • Page title modification
  • +
  • Updated User dropdown List
  • +
+ +
+
+
+
+ + + + + + +
+
+
+ + + +
+
+ +

Overview

+
+

+ Odoo Debranding module helps you to change the aesthetic look of Odoo software via customizing. The module helps you to remove all odoo reference from Front end and Back end.

+ +
+ +

Odoo Debranding

+
+
    + +

    + Available in Odoo 13.0 community edition.

    + +

    + Modify database selector page.

    + +

    + Modify login page (Remove 'Powered by odoo').

    + +

    + Page title modification (Remove Odoo from Title)

    + +

    + Updated User dropdown List (Remove 'Accounts and Documentation')

    +

    + Remove About from Configuration menu.

    + +
+
+ + + +
+ +
+

Screenshots

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

Video

+
+

Odoo debranding Demo

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

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 +
+
+ +
+
+ + +
+
+
+ + + + +
+
+ +
+ + + + + + + + +
+
+
+
+ diff --git a/customize_settings/static/src/js/title.js b/customize_settings/static/src/js/title.js new file mode 100644 index 000000000..ba49c09b8 --- /dev/null +++ b/customize_settings/static/src/js/title.js @@ -0,0 +1,100 @@ +odoo.define('customize_settings.title', function(require) { +"use strict"; + +var core = require('web.core'); +var session = require('web.session'); +var _t = core._t; +var _lt = core._lt; +var name = " "; +var Widget = require('web.Widget'); +var WebClient = require('web.WebClient'); + +var map_title ={ + user_error: _lt('Warning'), + warning: _lt('Warning'), + access_error: _lt('Access Error'), + missing_error: _lt('Missing Record'), + validation_error: _lt('Validation Error'), + except_orm: _lt('Global Business Error'), + access_denied: _lt('Access Denied'), +}; + +var myWebClient = WebClient.include({ + + start: function () { + this._super.apply(this, arguments); + var domain = session.user_context.allowed_company_ids; + var obj = this; + this._rpc({ + fields: ['name','id',], + domain: [['id', 'in', domain]], + model: 'res.company', + method: 'search_read', + }) + .then(function (result) { + obj.set('title_part', {"zopenerp": result[0].name}); // Replacing the name 'Oodo' to selected company name near favicon + }); + }, +}); + +var ExceptionHandler = { + init: function(parent, error) {}, + display: function() {}, +}; + +var RedirectWarningHandler = Widget.extend(ExceptionHandler, { // Odoo warning removed + init: function(parent, error) { + this._super(parent); + this.error = error; + }, + display: function() { + var self = this; + var error = this.error; + var additional_context = _.extend({}, this.context, error.data.arguments[3]); + + new WarningDialog(this, { + title: _.str.capitalize(error.type) || _t("Warning"), + buttons: [ + {text: error.data.arguments[2], classes : "btn-primary", click: function() { + self.do_action( + error.data.arguments[1], + { + additional_context: additional_context, + }); + self.destroy(); + }, close: true}, + {text: _t("Cancel"), click: function() { self.destroy(); }, close: true} + ] + }, { + message: error.data.arguments[0], + }).open(); + } +}); + +core.crash_registry.add('odoo.exceptions.RedirectWarning', RedirectWarningHandler); + + +function session_expired(cm) { // Odoo session expired message + return { + display: function () { + const notif = { + type: _t("Session Expired"), + message: _t("Your session expired. The current page is about to be refreshed."), + }; + const options = { + buttons: [{ + text: _t("Ok"), + click: () => window.location.reload(true), + close: true + }], + }; + cm.show_warning(notif, options); + } + }; +} + + +core.crash_registry.add('odoo.http.SessionExpiredException', session_expired); +core.crash_registry.add('werkzeug.exceptions.Forbidden', session_expired); + +}); diff --git a/customize_settings/static/src/xml/base.xml b/customize_settings/static/src/xml/base.xml new file mode 100644 index 000000000..a153fbc7f --- /dev/null +++ b/customize_settings/static/src/xml/base.xml @@ -0,0 +1,12 @@ + + + + + + +