diff --git a/app_odoo_customize/__init__.py b/app_odoo_customize/__init__.py index e49c8b6f..57065ce7 100644 --- a/app_odoo_customize/__init__.py +++ b/app_odoo_customize/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- -import models +from . import models +from . import controllers diff --git a/app_odoo_customize/__openerp__.py b/app_odoo_customize/__openerp__.py index fd243a50..355e3418 100644 --- a/app_odoo_customize/__openerp__.py +++ b/app_odoo_customize/__openerp__.py @@ -46,6 +46,8 @@ You can config odoo, make it look like your own platform. 15. Reset All the Sequence to beginning of 1: SO/PO/MO/Invoice... 16. Fix odoo reload module translation bug while enable english language 17. Stop Odoo Auto Subscribe(Performance Improve) +18. Show/Hide Author and Website in Apps Dashboard (odoo 11 only) +19. Set System Icon (odoo 10 only) This module can help to white label the Odoo. Also helpful for training and support for your odoo end-user. @@ -57,8 +59,11 @@ The user can get the help document just by one click. 'data': [ 'views/app_odoo_customize_view.xml', 'views/app_theme_config_settings_view.xml', + 'views/res_company_view.xml', + 'views/templates.xml', # data 'data/ir_config_parameter.xml', + 'data/res_company_data.xml', ], 'demo': [], 'test': [ diff --git a/app_odoo_customize/controllers/__init__.py b/app_odoo_customize/controllers/__init__.py new file mode 100644 index 00000000..b72efe00 --- /dev/null +++ b/app_odoo_customize/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import web_favicon diff --git a/app_odoo_customize/controllers/web_favicon.py b/app_odoo_customize/controllers/web_favicon.py new file mode 100644 index 00000000..319fa841 --- /dev/null +++ b/app_odoo_customize/controllers/web_favicon.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +# Created on 2018-04-11 +# author: 广州尚鹏,http://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +# Odoo在线中文用户手册(长期更新) +# http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# http://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# http://www.sunpop.cn/odoo10_developer_document_offline/ +# description: + +import StringIO +import base64 +from odoo import http +from odoo.tools.misc import file_open + + +class WebFavicon(http.Controller): + + @http.route('/web_favicon/favicon', type='http', auth="none") + def icon(self): + request = http.request + if 'uid' in request.env.context: + user = request.env['res.users'].browse(request.env.context['uid']) + company = user.sudo(user.id).company_id + else: + company = request.env['res.company'].search([], limit=1) + favicon = company.favicon_backend + favicon_mimetype = company.favicon_backend_mimetype + if not favicon: + favicon = file_open('web/static/src/img/favicon.ico') + favicon_mimetype = 'image/x-icon' + else: + favicon = StringIO.StringIO(base64.b64decode(favicon)) + return request.make_response( + favicon.read(), [('Content-Type', favicon_mimetype)]) diff --git a/app_odoo_customize/data/res_company_data.xml b/app_odoo_customize/data/res_company_data.xml new file mode 100644 index 00000000..06ad0560 --- /dev/null +++ b/app_odoo_customize/data/res_company_data.xml @@ -0,0 +1,9 @@ + + + + + image/png + + + + \ No newline at end of file diff --git a/app_odoo_customize/models/__init__.py b/app_odoo_customize/models/__init__.py index 36ac87dc..0d82e079 100644 --- a/app_odoo_customize/models/__init__.py +++ b/app_odoo_customize/models/__init__.py @@ -4,3 +4,4 @@ import ir_ui_view import app_theme_config_settings import base_language_install import mail_thread +import res_company diff --git a/app_odoo_customize/models/app_theme_config_settings.py b/app_odoo_customize/models/app_theme_config_settings.py index 44079a48..23d73092 100644 --- a/app_odoo_customize/models/app_theme_config_settings.py +++ b/app_odoo_customize/models/app_theme_config_settings.py @@ -32,6 +32,15 @@ class AppThemeConfigSettings(models.TransientModel): app_account_title = fields.Char('My Odoo.com Account Title') app_account_url = fields.Char('My Odoo.com Account Url') + company_id = fields.Many2one( + 'res.company', 'Company', + default=lambda self: self.env.user.company_id, required=True) + app_favicon_backend = fields.Binary(related='company_id.favicon_backend', string="Favicon backend") + app_favicon_backend_mimetype = fields.Selection( + related='company_id.favicon_backend_mimetype', + string='Favicon mimetype', + help='Set the mimetype of your file.') + @api.model def get_default_all(self, fields): ir_config = self.env['ir.config_parameter'] @@ -72,7 +81,10 @@ class AppThemeConfigSettings(models.TransientModel): app_documentation_dev_url=app_documentation_dev_url, app_support_url=app_support_url, app_account_title=app_account_title, - app_account_url=app_account_url + app_account_url=app_account_url, + company_id=self.env.user.company_id.id, + app_favicon_backend=self.env.user.company_id.favicon_backend, + app_favicon_backend_mimetype=self.env.user.company_id.favicon_backend_mimetype, ) @api.multi diff --git a/app_odoo_customize/models/res_company.py b/app_odoo_customize/models/res_company.py new file mode 100644 index 00000000..e34993b8 --- /dev/null +++ b/app_odoo_customize/models/res_company.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +# Created on 2018-04-11 +# author: 广州尚鹏,http://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +# Odoo在线中文用户手册(长期更新) +# http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# http://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# http://www.sunpop.cn/odoo10_developer_document_offline/ +# description: + +from openerp import api, fields, models, _ + +class ResCompany(models.Model): + _inherit = 'res.company' + + favicon_backend = fields.Binary(string="Favicon backend") + favicon_backend_mimetype = fields.Selection( + selection=[('image/x-icon', 'image/x-icon'), + ('image/gif', 'image/gif'), + ('image/png', 'image/png')], + string='Favicon mimetype', + help='Set the mimetype of your file.') diff --git a/app_odoo_customize/static/description/index.html b/app_odoo_customize/static/description/index.html index 565c9e10..0ae962d5 100644 --- a/app_odoo_customize/static/description/index.html +++ b/app_odoo_customize/static/description/index.html @@ -5,11 +5,14 @@

This moduld allows user to quickly customize and debranding Odoo. Quick debug, Language Switcher, Online Documentation Access,Quick Data Clear.

+

Lastest update: v11.0.3.23

+

Add 18. Show/Hide Author and Website in Apps Dashboard

+

Fix some bug.

More Powerful UI addons: App UI enhance


-

Lastest update: v10.0.2.4, 2018-02-04

+

Add Odoo 11 Support

This module can help to white label the Odoo. @@ -78,6 +83,34 @@

+
+
+

Set System Icon (odoo 10 only)

+
+
+ +
+
+
+ +
+
+

Show/Hide Author and Website in Apps Dashboard

+
+

Before

+
+ +
+
+

After uncheck "Show Author and Website in Apps Dashboard"

+
+ +
+
+
+
diff --git a/app_odoo_customize/static/description/set18-1.jpg b/app_odoo_customize/static/description/set18-1.jpg new file mode 100644 index 00000000..56c40177 Binary files /dev/null and b/app_odoo_customize/static/description/set18-1.jpg differ diff --git a/app_odoo_customize/static/description/set18-2.jpg b/app_odoo_customize/static/description/set18-2.jpg new file mode 100644 index 00000000..32028d74 Binary files /dev/null and b/app_odoo_customize/static/description/set18-2.jpg differ diff --git a/app_odoo_customize/static/description/set19.jpg b/app_odoo_customize/static/description/set19.jpg new file mode 100644 index 00000000..8bea0b62 Binary files /dev/null and b/app_odoo_customize/static/description/set19.jpg differ diff --git a/app_odoo_customize/static/src/img/icon76red.png b/app_odoo_customize/static/src/img/icon76red.png new file mode 100644 index 00000000..aa490954 Binary files /dev/null and b/app_odoo_customize/static/src/img/icon76red.png differ diff --git a/app_odoo_customize/views/app_theme_config_settings_view.xml b/app_odoo_customize/views/app_theme_config_settings_view.xml index 2b115b5a..6ab242a6 100644 --- a/app_odoo_customize/views/app_theme_config_settings_view.xml +++ b/app_odoo_customize/views/app_theme_config_settings_view.xml @@ -88,6 +88,16 @@
+ +