mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update customize
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import controllers
|
||||
from . import models
|
||||
from . import wizard
|
||||
from . import hooks
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
{
|
||||
'name': 'odoo 16 Customize OEM(Boost, Data reset)',
|
||||
'version': '16.23.08.05',
|
||||
'version': '16.23.08.15',
|
||||
'author': 'odooai.cn',
|
||||
'category': 'Extra Tools',
|
||||
'website': 'https://www.odooai.cn',
|
||||
@@ -135,6 +135,8 @@
|
||||
40. Fix support for enterprise version.
|
||||
41. Fix odoo bug, when click Preferences menu not hide in mobile.
|
||||
42. Add menu navbar setup for top or bottom. navigator footer support.
|
||||
43. Check to only Debug / Debug Assets for Odoo Admin. Deny debug from url for other user.
|
||||
44. Check to stop subscribe and follow. This to make odoo speed up.
|
||||
|
||||
This module can help to white label the Odoo.
|
||||
Also helpful for training and support for your odoo end-user.
|
||||
@@ -183,5 +185,8 @@
|
||||
39. 只有系统管理员可以操作快速debug
|
||||
40. 增强对企业版的支持
|
||||
41. 修正odoo原生移动端菜单bug,点击个人设置时,原菜单不隐藏等
|
||||
42. 可设置导航栏在上方还是下方,分开桌面与移动端.
|
||||
43. 可设置只允许管理员进入开发者模式,不可在url中直接debut=1来调试
|
||||
44. 可配置停用自动用户订阅功能,这会提速odoo,减少资源消耗
|
||||
""",
|
||||
}
|
||||
|
||||
4
app_odoo_customize/controllers/__init__.py
Normal file
4
app_odoo_customize/controllers/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# todo: website 有bug oauth
|
||||
from . import controllers
|
||||
25
app_odoo_customize/controllers/controllers.py
Normal file
25
app_odoo_customize/controllers/controllers.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import http
|
||||
from odoo.addons.portal.controllers.web import Home
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class KsHome(Home):
|
||||
|
||||
@http.route()
|
||||
def web_client(self, s_action=None, **kw):
|
||||
res = super(KsHome, self).web_client(s_action, **kw)
|
||||
|
||||
if kw.get('debug') in ['1', 'assets', 'assets,tests']:
|
||||
config_parameter = request.env['ir.config_parameter'].sudo()
|
||||
app_debug_only_admin = config_parameter.get_param('app_debug_only_admin')
|
||||
if request.session.uid and request.env.user.browse(request.session.uid)._is_admin():
|
||||
pass
|
||||
else:
|
||||
if app_debug_only_admin:
|
||||
return request.redirect('/web/session/logout?debug=0')
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
<function model="ir.config_parameter" name="set_param" eval="('app_ribbon_background_color', 'rgba(255,0,0,.4)')"/>
|
||||
<function model="ir.config_parameter" name="set_param" eval="('app_navbar_pos_pc', 'top')"/>
|
||||
<function model="ir.config_parameter" name="set_param" eval="('app_navbar_pos_mobile', 'bottom')"/>
|
||||
<function model="ir.config_parameter" name="set_param" eval="('app_debug_only_admin', 'True')"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -6,5 +6,6 @@ from . import ir_module_module
|
||||
from . import web_environment_ribbon_backend
|
||||
from . import ir_http
|
||||
from . import ir_module_addons_path
|
||||
from . import mail_thread
|
||||
# from . import ir_ui_view
|
||||
# from . import ir_ui_menu
|
||||
|
||||
@@ -32,4 +32,7 @@ class IrHttp(models.AbstractModel):
|
||||
# 增加 bar位置处理
|
||||
result['app_navbar_pos_pc'] = config_parameter.get_param('app_navbar_pos_pc', 'top')
|
||||
result['app_navbar_pos_mobile'] = config_parameter.get_param('app_navbar_pos_mobile', 'top')
|
||||
# 此处直接取,不用 session
|
||||
result['app_debug_only_admin'] = config_parameter.get_param('app_debug_only_admin')
|
||||
result['app_stop_subscribe'] = config_parameter.get_param('app_stop_subscribe')
|
||||
return result
|
||||
|
||||
44
app_odoo_customize/models/mail_thread.py
Normal file
44
app_odoo_customize/models/mail_thread.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class MailThread(models.AbstractModel):
|
||||
_inherit = "mail.thread"
|
||||
|
||||
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe', False) == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return True
|
||||
else:
|
||||
return super(MailThread, self).message_subscribe(partner_ids, channel_ids, subtype_ids)
|
||||
|
||||
def _message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None, customer_ids=None):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe', False) == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return True
|
||||
else:
|
||||
return super(MailThread, self)._message_subscribe(partner_ids, channel_ids, subtype_ids, customer_ids)
|
||||
|
||||
def _message_auto_subscribe_followers(self, updated_values, default_subtype_ids):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe', False) == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return []
|
||||
else:
|
||||
return super(MailThread, self)._message_auto_subscribe_followers(updated_values, default_subtype_ids)
|
||||
|
||||
def _message_auto_subscribe_notify(self, partner_ids, template):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe', False) == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return True
|
||||
else:
|
||||
return super(MailThread, self)._message_auto_subscribe_notify( partner_ids, template)
|
||||
@@ -55,6 +55,12 @@ class ResConfigSettings(models.TransientModel):
|
||||
# ('left', 'Left'),
|
||||
], config_parameter='app_navbar_pos_mobile')
|
||||
|
||||
# 安全与提速
|
||||
app_debug_only_admin = fields.Boolean('Debug for Admin', config_parameter='app_debug_only_admin',
|
||||
help="Check to only Debug / Debug Assets for Odoo Admin. Deny debug from url for other user.")
|
||||
app_stop_subscribe = fields.Boolean('Stop Odoo Subscribe', help="Check to stop subscribe and follow. This to make odoo speed up.",
|
||||
config_parameter='app_stop_subscribe')
|
||||
|
||||
def set_module_url(self):
|
||||
sql = "UPDATE ir_module_module SET website = '%s' WHERE license like '%s' and website <> ''" % (self.app_enterprise_url, 'OEEL%')
|
||||
try:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 430 KiB After Width: | Height: | Size: 449 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 258 KiB |
@@ -47,7 +47,12 @@
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">This is a Long Term Support Apps.</h2>
|
||||
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
||||
<h3>Update: v16.23.05.24</h3>
|
||||
<h3>Update: v16.23.08.15</h3>
|
||||
<p>43. Check to only Debug / Debug Assets for Odoo Admin. Deny debug from url for other user.</p>
|
||||
<p>44. Check to stop subscribe and follow. This to make odoo speed up.</p>
|
||||
<h3>Update: v16.23.07.25</h3>
|
||||
<p>42. Add menu navbar setup for top or bottom. navigator footer support.</p>
|
||||
<h3>Update: v16.23.07.14</h3>
|
||||
<p>41. Fix odoo bug, when click Preferences menu not hide in mobile.</p>
|
||||
<h3>Update: v16.23.05.04</h3>
|
||||
<p>Fix bug in mobile view in popup menu.</p>
|
||||
|
||||
@@ -29,6 +29,14 @@
|
||||
<field name="app_navbar_pos_mobile"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Security and Boost" name="app_security_boost">
|
||||
<group>
|
||||
<field name="app_debug_only_admin"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="app_stop_subscribe"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="User Menu">
|
||||
<group>
|
||||
<field name="app_show_lang"/>
|
||||
|
||||
Reference in New Issue
Block a user