Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️1️⃣2️⃣ web_debranding #633

Merged
merged 2 commits into from Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion attachment_large_object/__init__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# flake8:noqa

from . import ir_attachment
Expand Down
1 change: 0 additions & 1 deletion attachment_large_object/__openerp__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# attachment_large_object module for OpenERP,
Expand Down
1 change: 0 additions & 1 deletion attachment_large_object/ir_attachment.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import logging
import base64
from odoo import models, api
Expand Down
1 change: 0 additions & 1 deletion attachment_large_object/tests/test_attachment.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import base64

from openerp.tests.common import TransactionCase
Expand Down
1 change: 0 additions & 1 deletion base_session_store_psql/__init__.py
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
def post_load():
from . import http
1 change: 0 additions & 1 deletion base_session_store_psql/__openerp__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
"name": """Store sessions in postgresql""",
"summary": """Fixes "Session Expired" issue in destributed deployment""",
Expand Down
1 change: 0 additions & 1 deletion base_session_store_psql/http.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import logging

import odoo
Expand Down
1 change: 0 additions & 1 deletion base_session_store_psql/sessionstore.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, an open source suite of business apps
Expand Down
1 change: 0 additions & 1 deletion ir_attachment_force_storage/__init__.py
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import models
1 change: 0 additions & 1 deletion ir_attachment_force_storage/__openerp__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
{
'name': "Force move attachments to DB storage",
'version': '1.0.0',
Expand Down
31 changes: 15 additions & 16 deletions web_debranding/README.rst
Expand Up @@ -10,7 +10,7 @@ Removes references to odoo.com:
2. Replaces "Odoo" in page title
3. Replaces "Odoo" in help message for empty list.

Some list views has word Odoo when search return empty result. E.g. search random string at menu ``[[ Settings ]] >> Users & Copanies >> Companies`` that return empty result -- it has Odoo word
Some list views has word Odoo when search return empty result. E.g. search random string at menu ``[[ Settings ]] >> Users & Companies >> Companies`` that return empty result -- it has Odoo word

Create and manage the companies that will be managed by **Odoo** from here. Shops or subsidiaries can be created and maintained from here.

Expand All @@ -19,7 +19,7 @@ Removes references to odoo.com:
6. *(feature is not required in 11.0+ versions)*
7. Replaces "Odoo" in Dialog Box

E.g. try to remove Administrator via menu ``[[ Settings ]] >> Users & Copanies >> Users``. It will show warning
E.g. try to remove Administrator via menu ``[[ Settings ]] >> Users & Companies >> Users``. It will show warning

You can not remove the admin user as it is used internally for resources created by **Odoo** (updates, module installation, ...)

Expand All @@ -38,16 +38,16 @@ Removes references to odoo.com:
11. Disables server requests to odoo.com (publisher_warranty_url) - optional. Works only for non-enterprise versions of odoo, check `note <#enterprise-users-notice>`__ below.
12. *(feature is a part of p.5)*
13. Deletes Share block and branded parts of other blocks at ``[[ Settings ]] >> Dashboard``
14. Replaces "Odoo" in planner
15. Replaces footer in planner to a custom one.
14. *(feature is not required in 12.0+ versions)*
15. *(feature is not required in 12.0+ versions)*
16. Deletes "Odoo" in a request message for permission desktop notifications (yellow block at ``Discuss`` page). Replaces "Odoo" and icon in desktop notifications
17. [ENTERPRISE] Deletes odoo logo in application switcher
18. Hides Enterprise features in Settings
19. Replaces "Odoo" in all backend qweb templates

This provides a big part of debranding. You can find examples at menu ``[[ Settings ]] >> Dashboard`` in *Implementation* section
This provides a big part of debranding. You can find examples at menu ``[[ Invoicing ]] >> Dashboard >> Reconcile 5 items >> 'Automatic reconcilation' button title on hover``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to find example, that doesn't require installation of extra modules

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All examples in depended modules are replaced/hided via other ways in this module

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


Follow these implementation guides to get the most out of **Odoo**.
Let **odoo** try to reconcile entries for the user

20. Replaces "odoo.com" in hints, examples, etc.

Expand All @@ -61,8 +61,8 @@ Removes references to odoo.com:

22. [ENTERPRISE] Replaces icons for mobile devices with custom url
23. Replaces links to `documentation <https://www.odoo.com/documentation>`__ (e.g. "Help" in Import tool, "How-to" in paypal, etc.) to custom website
24. Removes official videos in planner
25. Replaces "Odoo" in *application installed* mails
24. *(feature is not required in 12.0+ versions)*
25. *(feature is not required in 12.0+ versions)*

Configuration
=============
Expand All @@ -76,29 +76,28 @@ module openf ``[[ Settings ]] >> Technical >> Parameters >> System Parameters``
* ``web_debranding.new_documentation_website`` (website with documentation instead of official one)
* ``web_debranding.favicon_url``
* ``web_debranding.send_publisher_warranty_url`` - set 0 to disable server requests to odoo.com and 1 otherwise (useful for enterprise contractors). Works only for non-enterprise versions of odoo, check `note <#enterprise-users-notice>`__ below.
* ``web_debranding.planner_footer``
* ``web_debranding.icon_url`` - icon for mobile devices. recommended size :192x192
* ``web_debranding.apple_touch_icon_url`` - icon for IOS Safari. recommended size :152x152


Note. More user friendly way to configure the module is available in `Brand Kit <https://apps.odoo.com/apps/modules/9.0/theme_kit/>`__.
Note. More user friendly way to configure the module is available in `Brand Kit <https://apps.odoo.com/apps/modules/11.0/theme_kit/>`__.

Further debranding
==================

* open addons/mail/data/mail_data.xml and edit Template "Notification Email" -- delete "using Odoo"
* open addons/website_livechat/website_livechat_data.xml and edit in "im_livechat_channel_data_website" record YourWebsiteWithOdoo.com string
* open addons/website_livechat/data/website_livechat_data.xml and edit in "im_livechat_channel_data_website" record YourWebsiteWithOdoo.com string
* install **website_debranding** module if module "Website Builder" is installed in your system
* install **pos_debranding** module if module "POS" is installed in your system
* delete "Odoo.com Accounts" record at Settings\\Users\\OAuth Providers if module "OAuth2 Authentication" is installed. in your system
* delete "Odoo.com Accounts" record at Settings\\Users & Companies\\OAuth Providers if module "OAuth2 Authentication" is installed in your system
* to debrand **/web/database/manager**:

* edit addons/web/views/database_manager.html file:

* delete or modify <title> tag
* delete or modify favicon
* delete or modify <img> tag with logo2.png
* delete or modify paragraph <p>Fill in this form to create an Odoo database...</p>
* delete or modify paragraph <p>Odoo is up and running! <br /> ...</p>
* delete or modify warning <div class="alert alert-warning">Warning, your Odoo database ...</div>

Auto-debrand new databases
Expand All @@ -114,17 +113,17 @@ To automatically install this module for every new databases set **'auto_install
* base_setup (built-in)
* bus (built-in)

Tested on Odoo 11.0 88ccc406035297210cadd5c6278f6f813899001e
Tested on Odoo 12.0 edd8bad5d97ee489e85504791c807f0099ef24b5

Enterprise users notice
=======================

* `Terms of Odoo Enterprise Subscription Agreement <https://www.odoo.com/documentation/user/9.0/legal/terms/enterprise.html#customer-obligations>`_ don't allow to disable server requests to odoo.com. For this reason feature #11 doesn't work in Enterprise version.
* `Terms of Odoo Enterprise Subscription Agreement <https://www.odoo.com/documentation/user/12.0/legal/terms/enterprise.html#customer-obligations>`_ don't allow to disable server requests to odoo.com. For this reason feature #11 doesn't work in Enterprise version.

Note
====

* You can also use our new extended `Brand Kit module <https://www.odoo.com/apps/modules/10.0/theme_kit>`_ to brand your odoo instance and create your theme in few clicks.
* You can also use our new extended `Brand Kit module <https://www.odoo.com/apps/modules/11.0/theme_kit>`_ to brand your odoo instance and create your theme in few clicks.

Need our service?
=================
Expand Down
1 change: 0 additions & 1 deletion web_debranding/__init__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
from . import controllers

Expand Down
11 changes: 4 additions & 7 deletions web_debranding/__manifest__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
{
'name': "Backend debranding",
'version': '11.0.1.0.23',
"summary": """Removes references to odoo""",
'version': '12.0.1.0.24',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
'category': 'Debranding',
Expand All @@ -12,23 +12,20 @@
'depends': [
'web',
'mail',
'web_planner',
'access_apps',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove access_apps? If it's temporarily, you must comment it out instead

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted access_app because the access_settings_menu's dependencies contain access_apps.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

'access_settings_menu',
],
'data': [
'security/web_debranding_security.xml',
'security/ir.model.access.csv',
'data.xml',
'views.xml',
'js.xml',
'pre_install.yml',
'pre_install.xml',
],
'qweb': [
'static/src/xml/web.xml',
],
"post_load": 'post_load',
'auto_install': False,
'uninstall_hook': 'uninstall_hook',
'installable': False
'installable': True
}
1 change: 0 additions & 1 deletion web_debranding/controllers/__init__.py
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import main
1 change: 0 additions & 1 deletion web_debranding/controllers/main.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import odoo
from odoo import http
from odoo.addons.web.controllers.main import Binary
Expand Down
4 changes: 0 additions & 4 deletions web_debranding/data.xml
@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="default_logo_module" model="ir.config_parameter">
<field name="key">web_debranding.default_logo_module</field>
<field name="value">web_debranding</field>
</record>
<record id="base.main_partner" model="res.partner">
<field name="image"></field>
</record>


</data>
</odoo>
1 change: 0 additions & 1 deletion web_debranding/fields.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo.fields import _String

from .models.ir_translation import debrand
Expand Down
5 changes: 0 additions & 5 deletions web_debranding/i18n/ru.po
Expand Up @@ -41,11 +41,6 @@ msgstr "Режим разработчика"
msgid "Developer mode is already activated"
msgstr "Режим разработчика уже активирован"

#. module: web_debranding
#: model:ir.model,name:web_debranding.model_web_planner
msgid "Planner"
msgstr ""

#. module: web_debranding
#: code:addons/web_debranding/models/ir_config_parameter.py:6
#: code:addons/web_debranding/models/ir_config_parameter.py:7
Expand Down
2 changes: 0 additions & 2 deletions web_debranding/js.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="debranding_title_js" name="Debranding title JS"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
Expand All @@ -21,5 +20,4 @@
src="/web_debranding/static/src/js/user_menu.js"></script>
</xpath>
</template>
</data>
</odoo>
2 changes: 0 additions & 2 deletions web_debranding/models/__init__.py
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from . import ir_actions
from . import ir_translation
from . import publisher_warranty_contract
from . import ir_config_parameter
from . import web_planner
from . import ir_ui_view
from . import mail_message
1 change: 0 additions & 1 deletion web_debranding/models/ir_actions.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import models


Expand Down
2 changes: 0 additions & 2 deletions web_debranding/models/ir_config_parameter.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from odoo import models, api
from odoo.tools.translate import _

Expand All @@ -9,7 +8,6 @@
('web_debranding.new_documentation_website', ''),
('web_debranding.favicon_url', ''),
('web_debranding.send_publisher_warranty_url', '0'),
('web_debranding.planner_footer', ''),
('web_debranding.icon_url', ''),
('web_debranding.apple_touch_icon_url', ''),

Expand Down
9 changes: 8 additions & 1 deletion web_debranding/models/ir_translation.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import re

from odoo import api
Expand Down Expand Up @@ -82,3 +81,11 @@ def get_field_string(self, model_name):
def get_field_help(self, model_name):
res = super(IrTranslation, self).get_field_help(model_name)
return self._debrand_dict(res)

@api.model
def decorated_clear_caches(self):
"""For calling clear_caches from via xml <function ... />
we wrapped it in the api.model decorator

"""
self.clear_caches()
1 change: 0 additions & 1 deletion web_debranding/models/ir_ui_view.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import logging
from odoo import models, api

Expand Down
1 change: 0 additions & 1 deletion web_debranding/models/mail_message.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import logging
from odoo import models, api

Expand Down
1 change: 0 additions & 1 deletion web_debranding/models/publisher_warranty_contract.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import logging

from odoo import models, api
Expand Down
27 changes: 0 additions & 27 deletions web_debranding/models/web_planner.py

This file was deleted.

6 changes: 6 additions & 0 deletions web_debranding/pre_install.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<function model="ir.config_parameter" name="create_debranding_parameters" />
<function model="ir.translation" name="decorated_clear_caches" />
<function model="ir.ui.view" name="_create_debranding_views" />
</odoo>
10 changes: 0 additions & 10 deletions web_debranding/pre_install.yml

This file was deleted.

3 changes: 0 additions & 3 deletions web_debranding/security/web_debranding_security.xml

This file was deleted.

26 changes: 16 additions & 10 deletions web_debranding/static/src/js/bot.js
Expand Up @@ -2,17 +2,23 @@ odoo.define('web_debranding.bot', function (require) {
"use strict";

require('web_debranding.dialog');
var chat_manager = require('mail.chat_manager');
var Message = require('mail.model.Message');
var session = require('web.session');
var ODOOBOT_ID = "ODOOBOT";

var make_message_super = chat_manager.make_message;
chat_manager.make_message = function(data){
var msg = make_message_super(data);
if (msg.author_id === ODOOBOT_ID) {
msg.avatar_src = '/web/binary/company_logo?company_id=' + session.company_id;
msg.displayed_author = 'Bot';
Message.include({
_getAuthorName: function () {
if (this._isOdoobotAuthor()) {
return "Bot";
}
return msg;
};
return this._super.apply(this, arguments);
},

getAvatarSource: function () {
var res = this._super.apply(this, arguments);
if (res === '/mail/static/src/img/odoo_o.png') {
return '/web/binary/company_logo?company_id=' + session.company_id;
}
return res;
}
});
});