diff --git a/backend_debranding_v12/README.rst b/backend_debranding_v12/README.rst new file mode 100755 index 0000000..3e0833b --- /dev/null +++ b/backend_debranding_v12/README.rst @@ -0,0 +1,35 @@ +======================= +Odoo debranding Kit +======================= + +In this Module Extra_Modules Folder We Put Two Modules. + +- POS Debranding +- Website Debranding + +Below Remove in Odoo: + +1. Deletes Odoo label in footer +2. Replaces "Odoo" in page title +3. Replaces "Odoo" in help message for empty list +4. Deletes Documentation, Support, About links +5. Replaces default logo by empty image +6. Replaces "Odoo" in Dialog Box +7. Replaces "Odoo" in strings marked for translation. +8. Replaces default favicon to a custom one +9. **Hides Apps menu** (by default, only admin (superuser) can see Apps menu. You could change it via tick "Show Modules Menu" in user's access rights tab) +10. Disables server requests to odoo.com (publisher_warranty_url) +11. Deletes "My odoo.com account" button +12. Deletes Apps and other blocks from Settings/Dashboard +13. Replaces "Odoo" in planner +14. Replaces footer in planner to a custom one. +15. Deletes "Odoo" in a request message for permission desktop notifications + +By default the module replaces "Odoo" to "Your Company/Tag". To configure +module open Settings\\System Parameters and modify + + - backend_debranding.new_title (put space in value if you don't need Brand in Title) + - backend_debranding.new_name (your Brand) + - backend_debranding.favicon_url + - backend_debranding.planner_footer + diff --git a/backend_debranding_v12/__init__.py b/backend_debranding_v12/__init__.py new file mode 100755 index 0000000..6a06cc3 --- /dev/null +++ b/backend_debranding_v12/__init__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from . import models +from . import controllers + +from odoo import SUPERUSER_ID + +MODULE = '_backend_debranding_v12' + + +def uninstall_hook(cr, registry): + registry['ir.model.data']._module_data_uninstall(cr, SUPERUSER_ID, [MODULE]) diff --git a/backend_debranding_v12/__manifest__.py b/backend_debranding_v12/__manifest__.py new file mode 100755 index 0000000..c515e56 --- /dev/null +++ b/backend_debranding_v12/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +{ + 'name': "Debranding Kit", + 'version': '12.0.0', + 'author': 'Planet-Odoo', + "support": "http://www.planet-odoo.com/", + 'category': 'Tools', + 'depends': [ + 'web', + 'mail', + #'web_settings_dashboard', + 'portal', + + ], + 'data': [ + 'views/data.xml', + 'views/views.xml', + 'views/js.xml', + 'views/webclient_templates.xml', + 'security/ir.model.access.csv', + + ], + 'qweb': [ + 'static/src/xml/web.xml', + 'static/src/xml/dashbord.xml', + + ], + 'images': ['static/description/main.png'], + 'license': "LGPL-3", + 'auto_install': False, + 'installable': True +} diff --git a/backend_debranding_v12/controllers/__init__.py b/backend_debranding_v12/controllers/__init__.py new file mode 100755 index 0000000..13b8d47 --- /dev/null +++ b/backend_debranding_v12/controllers/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import main +from . import database_manager \ No newline at end of file diff --git a/backend_debranding_v12/controllers/database_manager.py b/backend_debranding_v12/controllers/database_manager.py new file mode 100755 index 0000000..22ccb74 --- /dev/null +++ b/backend_debranding_v12/controllers/database_manager.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +import jinja2 +import json + +import odoo +from odoo import http +from odoo.addons.web.controllers.main import DBNAME_PATTERN, db_monodb,\ + Database as DB + +loader = jinja2.PackageLoader('odoo.addons.backend_debranding_v12', + "views") +env = jinja2.Environment(loader=loader, autoescape=True) +env.filters["json"] = json.dumps + + +class Database(DB): + + def _render_template(self, **d): + d.setdefault('manage', True) + d['insecure'] = odoo.tools.config['admin_passwd'] == '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 + # databases list + d['databases'] = [] + try: + d['databases'] = http.db_list() + except odoo.exceptions.AccessDenied: + monodb = db_monodb() + if monodb: + d['databases'] = [monodb] + return env.get_template("database_manager.html").render(d) \ No newline at end of file diff --git a/backend_debranding_v12/controllers/desktop.ini b/backend_debranding_v12/controllers/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/controllers/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/controllers/main.py b/backend_debranding_v12/controllers/main.py new file mode 100755 index 0000000..b10a292 --- /dev/null +++ b/backend_debranding_v12/controllers/main.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +import odoo +from odoo import http +from odoo.addons.web.controllers.main import Binary +import functools +from odoo.http import request +from odoo.modules import get_module_resource +# from cStringIO import StringIO +from io import StringIO +db_monodb = http.db_monodb + + +class BinaryCustom(Binary): + @http.route([ + '/web/binary/company_logo', + '/logo', + '/logo.png', + ], type='http', auth="none", cors="*") + def company_logo(self, dbname=None, **kw): + imgname = 'logo.png' + default_logo_module = 'backend_debranding_v12' + if request.session.db: + request.env['ir.config_parameter'].sudo().get_param('backend_debranding_v12.default_logo_module') + placeholder = functools.partial(get_module_resource, default_logo_module, 'static', 'src', 'img') + # print("--placeholder---",placeholder) + 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)) + else: + try: + # create an empty registry + registry = odoo.modules.registry.Registry(dbname) + with registry.cursor() as cr: + 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]: + # print("-----str(row[0])",str(row[0])) + # print(type(row[0])) + # image_data = StringIO(str(row[0].decode('base64'))) + # print("----row[0].tobytes()=--",row[0].tobytes()) + image_data = row[0].tobytes().decode('utf-8') + response = http.send_file(image_data, filename=imgname, mtime=row[1]) + else: + response = http.send_file(placeholder('nologo.png')) + except Exception: + response = http.send_file(placeholder(imgname)) + + return response + + + diff --git a/backend_debranding_v12/desktop.ini b/backend_debranding_v12/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/i18n/de.po b/backend_debranding_v12/i18n/de.po new file mode 100755 index 0000000..e976b54 --- /dev/null +++ b/backend_debranding_v12/i18n/de.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v11 +# +# Translators: +# Niki Waibel, 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: Niki Waibel, 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "E-Mail Vorlagen" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/i18n/es.po b/backend_debranding_v12/i18n/es.po new file mode 100755 index 0000000..9ff5d5d --- /dev/null +++ b/backend_debranding_v12/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v11 +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-15 14:50+0000\n" +"PO-Revision-Date: 2017-05-15 14:50+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "Plantillas de correo electrónico" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "Odoo" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "usando" diff --git a/backend_debranding_v12/i18n/es_MX.po b/backend_debranding_v12/i18n/es_MX.po new file mode 100755 index 0000000..c992609 --- /dev/null +++ b/backend_debranding_v12/i18n/es_MX.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v12 +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "Plantillas de Correo Electrónico" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/i18n/fr.po b/backend_debranding_v12/i18n/fr.po new file mode 100755 index 0000000..971b9a2 --- /dev/null +++ b/backend_debranding_v12/i18n/fr.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v11 +# +# Translators: +# Quentin THEURET , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-26 01:46+0000\n" +"PO-Revision-Date: 2018-02-26 01:46+0000\n" +"Last-Translator: Quentin THEURET , 2018\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "Modèles de courriel" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "Odoo" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "utilisant" diff --git a/backend_debranding_v12/i18n/hr.po b/backend_debranding_v12/i18n/hr.po new file mode 100755 index 0000000..e9bf054 --- /dev/null +++ b/backend_debranding_v12/i18n/hr.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v11 +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "Predlošci mailova" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/i18n/it.po b/backend_debranding_v12/i18n/it.po new file mode 100755 index 0000000..7d79380 --- /dev/null +++ b/backend_debranding_v12/i18n/it.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v11 +# +# Translators: +# Marius Marolla , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: Marius Marolla , 2018\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: backend_debranding_v11 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "Modelli Email" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v11/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/i18n/mail_debrand.pot b/backend_debranding_v12/i18n/mail_debrand.pot new file mode 100755 index 0000000..3fdbe37 --- /dev/null +++ b/backend_debranding_v12/i18n/mail_debrand.pot @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v12 +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: backend_debranding_v12 +#: model:ir.model,name:backend_debranding_v11.model_mail_template +msgid "Email Templates" +msgstr "" + +#. module: backend_debranding_v11 +#: code:addons/backend_debranding_v12/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v12 +#: code:addons/backend_debranding_v12/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" + diff --git a/backend_debranding_v12/i18n/nl_NL.po b/backend_debranding_v12/i18n/nl_NL.po new file mode 100755 index 0000000..fcb407d --- /dev/null +++ b/backend_debranding_v12/i18n/nl_NL.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v12 +# +# Translators: +# Peter Hageman , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: Peter Hageman , 2018\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: backend_debranding_v12 +#: model:ir.model,name:backend_debranding_v12.model_mail_template +msgid "Email Templates" +msgstr "E-mailsjablonen" + +#. module: backend_debranding_v12 +#: code:addons/backend_debranding_v12/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v12 +#: code:addons/backend_debranding_v12/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/i18n/zh_CN.po b/backend_debranding_v12/i18n/zh_CN.po new file mode 100755 index 0000000..c4dbe3a --- /dev/null +++ b/backend_debranding_v12/i18n/zh_CN.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * backend_debranding_v12 +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-24 03:51+0000\n" +"PO-Revision-Date: 2018-01-24 03:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: backend_debranding_v12 +#: model:ir.model,name:backend_debranding_v12.model_mail_template +msgid "Email Templates" +msgstr "Email 模板" + +#. module: backend_debranding_v12 +#: code:addons/backend_debranding_v12/models/mail_template.py:25 +#, python-format +msgid "Odoo" +msgstr "" + +#. module: backend_debranding_v12 +#: code:addons/backend_debranding_v12/models/mail_template.py:24 +#, python-format +msgid "using" +msgstr "" diff --git a/backend_debranding_v12/models/__init__.py b/backend_debranding_v12/models/__init__.py new file mode 100755 index 0000000..a83906a --- /dev/null +++ b/backend_debranding_v12/models/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +from . import ir_actions +from . import ir_translation +from . import ir_config_parameter +# from . import web_planner +from . import ir_ui_view +from . import fields +from . import mail_template +from . import res_users diff --git a/backend_debranding_v12/models/desktop.ini b/backend_debranding_v12/models/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/models/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/models/fields.py b/backend_debranding_v12/models/fields.py new file mode 100755 index 0000000..158b4ea --- /dev/null +++ b/backend_debranding_v12/models/fields.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +from odoo.fields import _String + +get_trans_func = _String.get_trans_func + + +def get_trans_func_debrand(self, records): + # check either backend_debranding is installed + if not hasattr(records.env['ir.translation'], '_debrand'): + return get_trans_func(self, records) + + if True: # keep original indent + if callable(self.translate): + rec_src_trans = records.env['ir.translation']._get_terms_translations(self, records) + + def translate(record_id, value): + src_trans = rec_src_trans[record_id] + + def tr(source): + trans = src_trans.get(source, source) + return records.env['ir.translation']._debrand(trans) + return self.translate(tr, value) + + else: + rec_trans = records.env['ir.translation']._get_ids( + '%s,%s' % (self.model_name, self.name), 'model', records.env.lang, records.ids) + + def translate(record_id, value): + return rec_trans.get(record_id) or value + + return translate + +_String.get_trans_func = get_trans_func_debrand diff --git a/backend_debranding_v12/models/ir_actions.py b/backend_debranding_v12/models/ir_actions.py new file mode 100755 index 0000000..18a6fc2 --- /dev/null +++ b/backend_debranding_v12/models/ir_actions.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +from odoo import api, models +from odoo.tools.translate import _ + + +class ir_actions_act_window_debranding(models.Model): + _inherit = 'ir.actions.act_window' + + def read(self, fields=None, load='_classic_read'): + """ call the method get_empty_list_help of the model and set the window action help message + """ + result = super(ir_actions_act_window_debranding, self).read(fields, load=load) + if not fields or 'help' in fields: + new_name = self.env['ir.config_parameter'].get_param('backend_debranding_v12.new_name') + new_name = new_name and new_name.strip() or _('Software') + for values in result: + model = values.get('res_model') + if model in self.env: + values['help'] = self.env[model].get_empty_list_help(values.get('help', "")) + if values['help']: + values['help'] = values['help'].replace('Odoo', new_name) + return result diff --git a/backend_debranding_v12/models/ir_config_parameter.py b/backend_debranding_v12/models/ir_config_parameter.py new file mode 100755 index 0000000..06d09e7 --- /dev/null +++ b/backend_debranding_v12/models/ir_config_parameter.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +from odoo import models, api, tools + +PARAMS = [ + 'backend_debranding_v12.new_name', + 'backend_debranding_v12.new_title', + 'backend_debranding_v12.favicon_url', + 'backend_debranding_v12.planner_footer', + 'backend_debranding_v12.default_logo_module' +] + + +class IrConfigParameter(models.Model): + _inherit = 'ir.config_parameter' + + @api.model + @tools.ormcache() + def get_debranding_parameters(self): + res = {} + for param in PARAMS: + value = self.env['ir.config_parameter'].get_param(param) + res[param] = value + return res + + def write(self, vals, context=None): + res = super(IrConfigParameter, self).write(vals) + for r in self: + if r.key in PARAMS: + self.get_debranding_parameters.clear_cache(self) + break + return res diff --git a/backend_debranding_v12/models/ir_translation.py b/backend_debranding_v12/models/ir_translation.py new file mode 100755 index 0000000..32d99d5 --- /dev/null +++ b/backend_debranding_v12/models/ir_translation.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import re + +from odoo import api, models, tools + + +class ir_translation(models.Model): + _inherit = 'ir.translation' + + def _debrand_dict(self, res): + for k in res: + res[k] = self._debrand(res[k]) + return res + + def _debrand(self, source): + if not source or not re.search(r'\bodoo\b', source, re.IGNORECASE): + return source + + new_name = self.env['ir.config_parameter'].sudo().get_param('backend_debranding_v12.new_name') + + if not new_name: + return source + substitute=re.sub(r'\bodoo\b', new_name, source, flags=re.IGNORECASE) + return substitute + # return source + + @tools.ormcache('name', 'types', 'lang', 'source', 'res_id') + def __get_source(self, name, types, lang, source, res_id): + res = super(ir_translation, self).__get_source(name, types, lang, source, res_id) + return self._debrand(res) + + @api.model + @tools.ormcache_context('model_name', keys=('lang',)) + def get_field_string(self, model_name): + res = super(ir_translation, self).get_field_string(model_name) + return self._debrand_dict(res) + + @api.model + @tools.ormcache_context('model_name', keys=('lang',)) + def get_field_help(self, model_name): + res = super(ir_translation, self).get_field_help(model_name) + return self._debrand_dict(res) diff --git a/backend_debranding_v12/models/ir_ui_view.py b/backend_debranding_v12/models/ir_ui_view.py new file mode 100755 index 0000000..5b31253 --- /dev/null +++ b/backend_debranding_v12/models/ir_ui_view.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +from odoo import SUPERUSER_ID, models + +MODULE = '_backend_debranding_v12' + + +class view(models.Model): + _inherit = 'ir.ui.view' + + def _create_debranding_views(self): + + self._create_view('menu_secondary', 'web.menu_secondary', ''' + + + ''') + + def _create_view(self, name, inherit_id, arch, noupdate=False, type='qweb'): + registry = self.pool + view_id = registry['ir.model.data'].xmlid_to_res_id(SUPERUSER_ID, "%s.%s" % (MODULE, name)) + if view_id: + registry['ir.ui.view'].write(SUPERUSER_ID, [view_id], { + 'arch': arch, + }) + return view_id + + try: + view_id = registry['ir.ui.view'].create(SUPERUSER_ID, { + 'name': name, + 'type': type, + 'arch': arch, + 'inherit_id': registry['ir.model.data'].xmlid_to_res_id(SUPERUSER_ID, inherit_id, raise_if_not_found=True) + }) + except: + import traceback + traceback.print_exc() + return + registry['ir.model.data'].create(SUPERUSER_ID, { + 'name': name, + 'model': 'ir.ui.view', + 'module': MODULE, + 'res_id': view_id, + 'noupdate': noupdate, + }) + return view_id diff --git a/backend_debranding_v12/models/mail_template.py b/backend_debranding_v12/models/mail_template.py new file mode 100755 index 0000000..723ec4d --- /dev/null +++ b/backend_debranding_v12/models/mail_template.py @@ -0,0 +1,40 @@ +# Copyright 2018 Planet Odoo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# This is used for replacing odoo to Planet Odoo in emails + +import re +from odoo import _, api, models + + +class MailTemplate(models.Model): + _inherit = 'mail.template' + + def generate_email(self, res_ids, fields=None): + obj = self.with_context(mail_debrand=True) + return super(MailTemplate, obj).generate_email(res_ids, fields=fields) + + @api.model + def _debrand_body(self, body): + using_word = _('using') + # print(body) + body=re.sub( + _('Odoo') , "Planet Odoo", body, + ) + return re.sub( + 'https://www.odoo.com','http://www.planet-odoo.com/', body, + ) + + @api.model + def render_template(self, template_txt, model, res_ids, + post_process=False): + res = super(MailTemplate, self).render_template( + template_txt, model, res_ids, post_process=post_process, + ) + if self.env.context.get('mail_debrand'): + if isinstance(res, str): + res = self._debrand_body(res) + else: + for res_id, body in res.items(): + res[res_id] = self._debrand_body(body) + return res + diff --git a/backend_debranding_v12/models/res_users.py b/backend_debranding_v12/models/res_users.py new file mode 100755 index 0000000..ee5d8e6 --- /dev/null +++ b/backend_debranding_v12/models/res_users.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import _, api, exceptions, fields, models, modules +from odoo.tools import pycompat + + +class Users(models.Model): + """ Update of res.users class + - add a preference about sending emails about notifications + - make a new user follow itself + - add a welcome message + - add suggestion preference + - if adding groups to an user, check mail.channels linked to this user + group, and the user. This is done by overriding the write method. + """ + _inherit = 'res.users' + + notification_type = fields.Selection([ + ('email', 'Handle by Emails'), + ('inbox', 'Handle in Planet Odoo')], + 'Notification Management', required=True, default='email', + help="Policy on how to handle Chatter notifications:\n" + "- Emails: notifications are sent to your email\n" + "- Planet Odoo: notifications appear in your Planet Odoo Inbox") \ No newline at end of file diff --git a/backend_debranding_v12/models/web_planner.py b/backend_debranding_v12/models/web_planner.py new file mode 100755 index 0000000..4e4a3d1 --- /dev/null +++ b/backend_debranding_v12/models/web_planner.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from odoo import api, models +import re + + +class Planner(models.Model): + _inherit = 'web.planner' + + @api.model + def render(self, template_id, planner_app): + res = super(Planner, self).render(template_id, planner_app) + new_company = self.env['ir.config_parameter'].get_debranding_parameters().get('backend_debranding_v12.new_name') + planner_footer = self.env['ir.config_parameter'].get_debranding_parameters().get('backend_debranding_v12.planner_footer') + planner_footer = '

' + str(planner_footer) + '/p' + res = re.sub(r'

[^<]*to contact our accounting experts by using the[\s\S]*?', '', res) + res = re.sub(r'

Don\'t hesitate to[\s\S]*logo.png"/>', '', res) + res = re.sub(r'

Once it\'s fully working[\s\S]*odoo_logo.png"/>', planner_footer, res) + res = re.sub(r'[Oo]doo', str(new_company), res) + return res diff --git a/backend_debranding_v12/pre_install.yml b/backend_debranding_v12/pre_install.yml new file mode 100755 index 0000000..c5cbc85 --- /dev/null +++ b/backend_debranding_v12/pre_install.yml @@ -0,0 +1,7 @@ +- + !python {model: ir.translation}: | + self.clear_caches() + +# - +# !python {model: ir.ui.view}: | +# self._create_debranding_views(cr, uid) diff --git a/backend_debranding_v12/security/ir.model.access.csv b/backend_debranding_v12/security/ir.model.access.csv new file mode 100755 index 0000000..dfec080 --- /dev/null +++ b/backend_debranding_v12/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_ir_config_parameter_group_user,ir.config.parameter.group.user,base.model_ir_config_parameter,base.group_user,1,1,1,1 diff --git a/backend_debranding_v12/static/description/dashboard_drop.png b/backend_debranding_v12/static/description/dashboard_drop.png new file mode 100755 index 0000000..6dc1b67 Binary files /dev/null and b/backend_debranding_v12/static/description/dashboard_drop.png differ diff --git a/backend_debranding_v12/static/description/desktop.ini b/backend_debranding_v12/static/description/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/description/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/description/dialogbox_rename.png b/backend_debranding_v12/static/description/dialogbox_rename.png new file mode 100755 index 0000000..b990afd Binary files /dev/null and b/backend_debranding_v12/static/description/dialogbox_rename.png differ diff --git a/backend_debranding_v12/static/description/discuss.png b/backend_debranding_v12/static/description/discuss.png new file mode 100755 index 0000000..931e4f5 Binary files /dev/null and b/backend_debranding_v12/static/description/discuss.png differ diff --git a/backend_debranding_v12/static/description/error.png b/backend_debranding_v12/static/description/error.png new file mode 100755 index 0000000..1351e2c Binary files /dev/null and b/backend_debranding_v12/static/description/error.png differ diff --git a/backend_debranding_v12/static/description/icon.png b/backend_debranding_v12/static/description/icon.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/description/icon.png differ diff --git a/backend_debranding_v12/static/description/index.html b/backend_debranding_v12/static/description/index.html new file mode 100755 index 0000000..dc6bcf9 --- /dev/null +++ b/backend_debranding_v12/static/description/index.html @@ -0,0 +1,70 @@ +

+
+
+

Debranding Kit

+ +

+ Overview +

+

+ Want to debrand your company website? Debranding Kit module developed by Planet Odoo + helps you to change the aesthetic look of Odoo software via customizing them + with logo and other branding changes. The module helps you to change almost every area of Odoo visuals, + delivering a brand new customized website. +

+
+
+
+
+
+
+

+

+ Below Remove in Odoo:

+
+
+ 1. Deletes Odoo label in footer
+ 2. Replaces "Odoo" in page title
+ 3.Deletes Apps and other blocks from Settings/Dashboard.
+ 4.Odoo accounts and documentation is removed from the dropdown list.
+ 5.Deletes Apps and other blocks from Settings/Dashboard
+ 6.Update Odoo titles on Error Dialogues
+ 7.Replaces "Odoo" in Dialog Box
+ 8.Deletes "Odoo" in a request message for permission desktop notifications
+ 9. Replaces "Odoo" in help message for empty list
+ 10.Replaces default favicon to custom fevicon
+
+ +

+

+

+

+

+

+

+
+

By default the module replaces "Odoo" to "Your Company/Tag".

+

To configure module open Settings\\System Parameters and modify

+ - backend_debranding_v12.new_title (put space in value if you don't need Brand in Title)
+ - backend_debranding_v12.new_name (your Brand)
+ - backend_debranding_v12.favicon_url
+ - backend_debranding_v12.planner_footer
+
+
+ +
+
+
+
+

Help & Support

+
+
+

Odoo support services is available to help you.

+ +
+
+
\ No newline at end of file diff --git a/backend_debranding_v12/static/description/main.png b/backend_debranding_v12/static/description/main.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/description/main.png differ diff --git a/backend_debranding_v12/static/description/main_screenshot.png b/backend_debranding_v12/static/description/main_screenshot.png new file mode 100755 index 0000000..e7d6056 Binary files /dev/null and b/backend_debranding_v12/static/description/main_screenshot.png differ diff --git a/backend_debranding_v12/static/description/setting_logo.png b/backend_debranding_v12/static/description/setting_logo.png new file mode 100755 index 0000000..da32bfd Binary files /dev/null and b/backend_debranding_v12/static/description/setting_logo.png differ diff --git a/backend_debranding_v12/static/description/system_parameter.png b/backend_debranding_v12/static/description/system_parameter.png new file mode 100755 index 0000000..3a6403b Binary files /dev/null and b/backend_debranding_v12/static/description/system_parameter.png differ diff --git a/backend_debranding_v12/static/description/v_0_20.png b/backend_debranding_v12/static/description/v_0_20.png new file mode 100755 index 0000000..e7d6056 Binary files /dev/null and b/backend_debranding_v12/static/description/v_0_20.png differ diff --git a/backend_debranding_v12/static/description/website_change.png b/backend_debranding_v12/static/description/website_change.png new file mode 100755 index 0000000..9504192 Binary files /dev/null and b/backend_debranding_v12/static/description/website_change.png differ diff --git a/backend_debranding_v12/static/description/website_custom.png b/backend_debranding_v12/static/description/website_custom.png new file mode 100755 index 0000000..9531aaa Binary files /dev/null and b/backend_debranding_v12/static/description/website_custom.png differ diff --git a/backend_debranding_v12/static/desktop.ini b/backend_debranding_v12/static/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/css/common.css b/backend_debranding_v12/static/src/css/common.css new file mode 100755 index 0000000..261f857 --- /dev/null +++ b/backend_debranding_v12/static/src/css/common.css @@ -0,0 +1,10 @@ + +a:hover, a:focus { + color: #FFFFFF; + text-decoration: underline; +} + +#oe_main_menu_navbar .oe_topbar_avatar { + max-height: 18px; + width: 18px; +} \ No newline at end of file diff --git a/backend_debranding_v12/static/src/css/desktop.ini b/backend_debranding_v12/static/src/css/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/css/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/css/left_menu.css b/backend_debranding_v12/static/src/css/left_menu.css new file mode 100755 index 0000000..834190d --- /dev/null +++ b/backend_debranding_v12/static/src/css/left_menu.css @@ -0,0 +1,3 @@ +.o_sub_menu{ +background-color: #9ACD32; +} \ No newline at end of file diff --git a/backend_debranding_v12/static/src/css/left_menu_text.css b/backend_debranding_v12/static/src/css/left_menu_text.css new file mode 100755 index 0000000..f1282ac --- /dev/null +++ b/backend_debranding_v12/static/src/css/left_menu_text.css @@ -0,0 +1,21 @@ +/* for main menu*/ +.o_web_client > .o_main .o_sub_menu .o_sub_menu_content .oe_secondary_menu_section{ + color: #000000; +} +/* submenu*/ + +.o_web_client > .o_main .o_sub_menu .o_sub_menu_content .oe_secondary_submenu > li:not(.active) > a{ + color: #000000; +} + +a{ + color:#000000; +} + +.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { +background-color:#000000; +} + +body{ +color:#000000; +} \ No newline at end of file diff --git a/backend_debranding_v12/static/src/css/menu.css b/backend_debranding_v12/static/src/css/menu.css new file mode 100755 index 0000000..c5fb6cd --- /dev/null +++ b/backend_debranding_v12/static/src/css/menu.css @@ -0,0 +1,3 @@ +#oe_main_menu_navbar { + background-color: #cc66ff; +} diff --git a/backend_debranding_v12/static/src/css/menu_text.css b/backend_debranding_v12/static/src/css/menu_text.css new file mode 100755 index 0000000..8b4f399 --- /dev/null +++ b/backend_debranding_v12/static/src/css/menu_text.css @@ -0,0 +1,39 @@ +/*.navbar-inverse .navbar-text { + color: #660000; +}*/ +.navbar-inverse .navbar-nav > li > a { + color: #ffffff; +} + +.openerp .oe_secondary_menu_section { + color:#cc66ff; +} + +/*.openerp .oe_secondary_submenu .oe_menu_text { + color:#ffffff; +}*/ + + +.openerp .nav-pills > li.active > a, .openerp a.list-group-item.active > a{ + background-color: #cc66ff; +} + +.openerp .oe_application a { + color:#cc66ff; +} + + +.openerp .nav-pills > li.active a:hover, .openerp .nav-pills > li.active a:focus, +.openerp a.list-group-item.active a:hover, .openerp a.list-group-item.active a:focus{ + background-color: #cc66ff; +} + +.openerp .badge { + background-color: #cc66ff; +} + +.openerp .oe_view_manager table.oe_view_manager_header h2 a{ + color: #cc66ff; +} + + diff --git a/backend_debranding_v12/static/src/css/web.css b/backend_debranding_v12/static/src/css/web.css new file mode 100755 index 0000000..846379b --- /dev/null +++ b/backend_debranding_v12/static/src/css/web.css @@ -0,0 +1,3 @@ +.o_application_switcher .o_application_switcher_footer{ + display: none; +} \ No newline at end of file diff --git a/backend_debranding_v12/static/src/desktop.ini b/backend_debranding_v12/static/src/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/img/apc_new.jpg b/backend_debranding_v12/static/src/img/apc_new.jpg new file mode 100755 index 0000000..6744d53 Binary files /dev/null and b/backend_debranding_v12/static/src/img/apc_new.jpg differ diff --git a/backend_debranding_v12/static/src/img/desktop.ini b/backend_debranding_v12/static/src/img/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/img/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/img/logo.png b/backend_debranding_v12/static/src/img/logo.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/src/img/logo.png differ diff --git a/backend_debranding_v12/static/src/img/nologo.png b/backend_debranding_v12/static/src/img/nologo.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/src/img/nologo.png differ diff --git a/backend_debranding_v12/static/src/img/planet_odoo2x.png b/backend_debranding_v12/static/src/img/planet_odoo2x.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/src/img/planet_odoo2x.png differ diff --git a/backend_debranding_v12/static/src/img/planet_odoo64x.png b/backend_debranding_v12/static/src/img/planet_odoo64x.png new file mode 100755 index 0000000..f9edc92 Binary files /dev/null and b/backend_debranding_v12/static/src/img/planet_odoo64x.png differ diff --git a/backend_debranding_v12/static/src/img/planet_odoo8x.png b/backend_debranding_v12/static/src/img/planet_odoo8x.png new file mode 100755 index 0000000..a0015ae Binary files /dev/null and b/backend_debranding_v12/static/src/img/planet_odoo8x.png differ diff --git a/backend_debranding_v12/static/src/js/announcement.js b/backend_debranding_v12/static/src/js/announcement.js new file mode 100755 index 0000000..80351a8 --- /dev/null +++ b/backend_debranding_v12/static/src/js/announcement.js @@ -0,0 +1,9 @@ +odoo.define('backend_debranding_v12.announcement', function(require) { + "use strict"; + + // require('mail.announcement'); + var WebClient = require('web.WebClient'); + WebClient.include({ + show_annoucement_bar: function() {} + }); +}); diff --git a/backend_debranding_v12/static/src/js/dashboard.js b/backend_debranding_v12/static/src/js/dashboard.js new file mode 100755 index 0000000..afde59c --- /dev/null +++ b/backend_debranding_v12/static/src/js/dashboard.js @@ -0,0 +1,13 @@ +odoo.define('backend_debranding_v12.dashboard', function (require) { +"use strict"; + + var dashboard = require('web_settings_dashboard'); + dashboard.Dashboard.include({ + start: function(){ + this.all_dashboards = _.without(this.all_dashboards, 'planner', 'apps'); + this.$('.o_web_settings_dashboard_apps').parent().remove(); + this.$('.o_web_settings_dashboard_planner').parent().remove(); + return this._super(); + }, + }); +}); diff --git a/backend_debranding_v12/static/src/js/desktop.ini b/backend_debranding_v12/static/src/js/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/js/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/js/dialog.js b/backend_debranding_v12/static/src/js/dialog.js new file mode 100755 index 0000000..eeb05bf --- /dev/null +++ b/backend_debranding_v12/static/src/js/dialog.js @@ -0,0 +1,76 @@ +odoo.define('backend_debranding.dialog', function(require) { + var core = require('web.core'); + var QWeb = core.qweb; + var _t = core._t; + var rpc = require('web.rpc'); +// var Model = require('web.DataModel') +// var debranding_new_name = 'Ctotal'; + var debranding_new_name = 'Planet Odoo'; +// var model = new Model("ir.config_parameter"); + var r = rpc.query({ + model: 'ir.config_parameter', + method: 'search_read', + args: [[['key', '=', 'backend_debranding.new_name']],['value']], + limit: 1, + }).then(function (data) { + if (!data.length) + return; + debranding_new_name = data[0].value; + }); + + var CrashManager = require('web.CrashManager') + CrashManager.include({ + init: function () { + this._super(); + var self = this; +// var model = new Model("ir.config_parameter"); + self.debranding_new_name = _t('Software'); + if (!openerp.session.db) + return; +// var r = model.query(['value']) +// .filter([['key', '=', 'backend_debranding.new_name']]) +// .limit(1) +// .all().then(function (data) { +// if (!data.length) +// return; +// self.debranding_new_name = data[0].value; +// }); + var r = rpc.query({ + model: 'ir.config_parameter', + method: 'search_read', + args: [[['key', '=', 'backend_debranding.new_name']],['value']], + limit: 1, + }).then(function (data) { + if (!data.length) + return; + self.debranding_new_name = data[0].value; + }); + }, + }); + + var Dialog = require('web.Dialog') + Dialog.include({ + init: function (parent, options) { + + // TODO find another way to get debranding_new_name + if (parent && parent.debranding_new_name){ + debranding_new_name = parent.debranding_new_name; + } + options = options || {}; + if (options['title']){ + var title = options['title'].replace(/Odoo/ig, debranding_new_name); + options['title'] = title; + } else { + options['title'] = debranding_new_name; + } + if (options.$content){ + if (!(options.$content instanceof $)){ + options.$content = $(options.$content) + } + var content_html = options.$content.html().replace(/Odoo/ig, debranding_new_name); + options.$content.html(content_html); + } + this._super(parent, options); + }, + }); +}); diff --git a/backend_debranding_v12/static/src/js/field_upgrade.js b/backend_debranding_v12/static/src/js/field_upgrade.js new file mode 100755 index 0000000..538b4cb --- /dev/null +++ b/backend_debranding_v12/static/src/js/field_upgrade.js @@ -0,0 +1,33 @@ +odoo.define('backend_debranding_v12.field_upgrade', function(require) { + "use strict"; + + var core = require('web.core'); + var UpgradeBoolean = core.form_widget_registry.get('upgrade_boolean'); + var UpgradeRadio = core.form_widget_registry.get('upgrade_radio'); + + var include = { + 'start': function() { + var $el = this.$el; + var i = 1; + var MAX = 10; + while (true) { + if (i > MAX) + break; + i++; + if ($el.prop("tagName") == 'TR') { + $el.hide(); + break; + } + $el = $el.parent(); + if (!$el) + break; + } + }, + 'on_click_input': function() {} + }; + + //skip this for a while as we don't have example to test it + //UpgradeRadio.include(include); + + UpgradeBoolean.include(include); +}); diff --git a/backend_debranding_v12/static/src/js/title.js b/backend_debranding_v12/static/src/js/title.js new file mode 100755 index 0000000..893e18a --- /dev/null +++ b/backend_debranding_v12/static/src/js/title.js @@ -0,0 +1,64 @@ +odoo.define('backend_debranding.title', function(require) { +"use strict"; + var core = require('web.core'); + var QWeb = core.qweb; + var _t = core._t; + var WebClient = require('web.WebClient'); + var rpc = require('web.rpc'); +// var Model = require('web.DataModel'); +// var model = new Model("ir.config_parameter"); + var title_part +// var r = model.query(['value']) +// .filter([['key', '=', 'backend_debranding.new_title']]) +// .limit(1) +// .all().then(function (data) { +// if (!data.length) +// return; +// title_part = data[0].value; +// title_part = title_part.trim(); +// }); + var r = rpc.query({ + model: 'ir.config_parameter', + method: 'search_read', + args: [[['key', '=', 'backend_debranding.new_title']],['value']], + limit: 1, + }).then(function (data) { + if (!data.length) + return; + title_part = data[0].value; + title_part = title_part.trim(); + }); + WebClient.include({ + init: function(parent, client_options) { + this._super(parent, client_options); + + this.set('title_part', {"zopenerp": title_part}); +// this.get_title_part(); + }, + get_title_part: function(){ + if (!openerp.session.db) + return; + var self = this; +// var model = new Model("ir.config_parameter"); + +// var r = model.query(['value']) +// .filter([['key', '=', 'backend_debranding.new_title']]) +// .limit(1) +// .all().then(function (data) { +// if (!data.length) +// return; + var r = rpc.query({ + model: 'ir.config_parameter', + method: 'search_read', + args: [[['key', '=', 'backend_debranding.new_title']],['value']], + limit: 1, + }).then(function (data) { + if (!data.length) + return; + title_part = data[0].value; + title_part = title_part.trim(); + self.set('title_part', {"zopenerp": title_part}); + }); + }, + }); +}); diff --git a/backend_debranding_v12/static/src/less/desktop.ini b/backend_debranding_v12/static/src/less/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/less/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/less/variables.less b/backend_debranding_v12/static/src/less/variables.less new file mode 100755 index 0000000..fb2fc80 --- /dev/null +++ b/backend_debranding_v12/static/src/less/variables.less @@ -0,0 +1,50 @@ +@odoo-font-size-base: 13px; + +// Colors +@odoo-brand-primary: #9ACD32; +@odoo-brand-optional: #9ACD32; +@odoo-brand-secondary: #f0eeee; +@odoo-brand-lightsecondary: #e2e2e0; + +@odoo-color-pink: #a24689; +@odoo-main-color-muted: #a8a8a8; +@odoo-main-text-color: #4c4c4c; + +@odoo-view-background-color: white; +@odoo-shadow-color: #303030; + +@odoo-webclient-background-color: @odoo-brand-secondary; +@odoo-control-panel-background-color: @odoo-webclient-background-color; +@odoo-form-lightsecondary: #ccc; +@odoo-list-grey: @odoo-brand-lightsecondary; + +@odoo-list-footer-color: @odoo-main-text-color; +@odoo-list-footer-bg-color: #eee; +@odoo-list-footer-font-weight: bold; + +@odoo-tooltip-background-color: black; +@odoo-tooltip-color: white; +@odoo-tooltip-arrow-color: black; + +// Layout +@screen-xs-min: 475px; +@screen-xxs-max: (@screen-xs-min - 1); + +@odoo-form-group-cols: 12; +@odoo-form-spacing-unit: 5px; +@odoo-horizontal-padding: 16px; +@odoo-innergroup-rpadding: 45px; +@odoo-dropdown-hpadding: 25px; + +@border-radius-base: 3px; + +@odoo-sheet-vpadding: 24px; + +@odoo-avatar-size: 90px; + +@odoo-statusbar-height: 36px; +@odoo-statusbar-arrow-width: @odoo-statusbar-height/3; + +@odoo-label-font-size-factor: 0.8; +@odoo-navbar-height: 34px; +@odoo-navbar-inverse-link-hover-bg: darken(@odoo-brand-primary, 10%); diff --git a/backend_debranding_v12/static/src/xml/dashbord.xml b/backend_debranding_v12/static/src/xml/dashbord.xml new file mode 100755 index 0000000..fde2c4c --- /dev/null +++ b/backend_debranding_v12/static/src/xml/dashbord.xml @@ -0,0 +1,33 @@ + diff --git a/backend_debranding_v12/static/src/xml/desktop.ini b/backend_debranding_v12/static/src/xml/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/static/src/xml/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/static/src/xml/web.xml b/backend_debranding_v12/static/src/xml/web.xml new file mode 100755 index 0000000..762a7dc --- /dev/null +++ b/backend_debranding_v12/static/src/xml/web.xml @@ -0,0 +1,23 @@ + + + + + Your permission is required to enable desktop notifications. + + + + + + + + + + + + + + + + + + diff --git a/backend_debranding_v12/views/change_menu_color.xml b/backend_debranding_v12/views/change_menu_color.xml new file mode 100755 index 0000000..3468ded --- /dev/null +++ b/backend_debranding_v12/views/change_menu_color.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend_debranding_v12/views/data.xml b/backend_debranding_v12/views/data.xml new file mode 100755 index 0000000..9b0ce36 --- /dev/null +++ b/backend_debranding_v12/views/data.xml @@ -0,0 +1,10 @@ + + + + backend_debranding_v12.default_logo_module + backend_debranding_v12 + + + + + diff --git a/backend_debranding_v12/views/database_manager.html b/backend_debranding_v12/views/database_manager.html new file mode 100755 index 0000000..733e870 --- /dev/null +++ b/backend_debranding_v12/views/database_manager.html @@ -0,0 +1,351 @@ + + + + + Planet Odoo + + + + + + + + + + +{% macro master_input() -%} +
+ {% if insecure %} + + {% else %} + + + {% endif %} +
+{%- endmacro %} + +{% macro create_form() -%} +

Planet Odoo is up and running!
+ Create a new database by filling out the form, + you'll be able to install your first app in a minute.

+ {{ master_input() }} +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+{%- endmacro %} + + + +
+
+
+ +
+ {% if insecure and databases %} +
+ Warning, your Planet Odoo database manager is not protected. + Please set a master password + to secure it. +
+ {% endif %} + {% if error %} +
{{ error }}
+ {% endif %} + {% if databases %} + + {% if manage %} +
+ + + +
+ {% else %} + + {% endif %} + {% else %} +
+ {{ create_form() }} + +
+ + or restore a database + + {% endif %} +
+
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend_debranding_v12/views/desktop.ini b/backend_debranding_v12/views/desktop.ini new file mode 100755 index 0000000..ff62497 --- /dev/null +++ b/backend_debranding_v12/views/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/backend_debranding_v12/views/js.xml b/backend_debranding_v12/views/js.xml new file mode 100755 index 0000000..dfb57ca --- /dev/null +++ b/backend_debranding_v12/views/js.xml @@ -0,0 +1,13 @@ + + + + diff --git a/backend_debranding_v12/views/views.xml b/backend_debranding_v12/views/views.xml new file mode 100755 index 0000000..bf7d2da --- /dev/null +++ b/backend_debranding_v12/views/views.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + backend_debranding_v12.new_name + Planet Odoo + + + backend_debranding_v12.new_title + Planet Odoo + + + backend_debranding_v12.favicon_url + /backend_debranding_v12/static/src/img/planet_odoo64x.png + + + backend_debranding_v12.planner_footer + Planet Odoo + + + diff --git a/backend_debranding_v12/views/webclient_templates.xml b/backend_debranding_v12/views/webclient_templates.xml new file mode 100755 index 0000000..c4491e0 --- /dev/null +++ b/backend_debranding_v12/views/webclient_templates.xml @@ -0,0 +1,52 @@ + + + + + + +