diff --git a/app_odoo_customize/__init__.py b/app_odoo_customize/__init__.py
index 32eadd1c..b2860ba3 100644
--- a/app_odoo_customize/__init__.py
+++ b/app_odoo_customize/__init__.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+from . import controllers
from . import models
from . import wizard
from . import hooks
diff --git a/app_odoo_customize/__manifest__.py b/app_odoo_customize/__manifest__.py
index 5f22841e..718a7eb6 100644
--- a/app_odoo_customize/__manifest__.py
+++ b/app_odoo_customize/__manifest__.py
@@ -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,减少资源消耗
""",
}
diff --git a/app_odoo_customize/controllers/__init__.py b/app_odoo_customize/controllers/__init__.py
new file mode 100644
index 00000000..0a3e6996
--- /dev/null
+++ b/app_odoo_customize/controllers/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+
+# todo: website 有bug oauth
+from . import controllers
\ No newline at end of file
diff --git a/app_odoo_customize/controllers/controllers.py b/app_odoo_customize/controllers/controllers.py
new file mode 100644
index 00000000..782c5364
--- /dev/null
+++ b/app_odoo_customize/controllers/controllers.py
@@ -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
+
+
+
diff --git a/app_odoo_customize/data/ir_config_parameter_data.xml b/app_odoo_customize/data/ir_config_parameter_data.xml
index 5bcdc4f2..41e39780 100644
--- a/app_odoo_customize/data/ir_config_parameter_data.xml
+++ b/app_odoo_customize/data/ir_config_parameter_data.xml
@@ -22,5 +22,6 @@
+
\ No newline at end of file
diff --git a/app_odoo_customize/models/__init__.py b/app_odoo_customize/models/__init__.py
index 4c7df871..8283382a 100644
--- a/app_odoo_customize/models/__init__.py
+++ b/app_odoo_customize/models/__init__.py
@@ -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
diff --git a/app_odoo_customize/models/ir_http.py b/app_odoo_customize/models/ir_http.py
index fba1cb01..c7306cf3 100644
--- a/app_odoo_customize/models/ir_http.py
+++ b/app_odoo_customize/models/ir_http.py
@@ -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
diff --git a/app_odoo_customize/models/mail_thread.py b/app_odoo_customize/models/mail_thread.py
new file mode 100644
index 00000000..1d93ab65
--- /dev/null
+++ b/app_odoo_customize/models/mail_thread.py
@@ -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)
diff --git a/app_odoo_customize/models/res_config_settings.py b/app_odoo_customize/models/res_config_settings.py
index 6715c44f..e2a2c2ae 100644
--- a/app_odoo_customize/models/res_config_settings.py
+++ b/app_odoo_customize/models/res_config_settings.py
@@ -54,6 +54,12 @@ class ResConfigSettings(models.TransientModel):
('bottom', 'Bottom'),
# ('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%')
diff --git a/app_odoo_customize/static/description/banner.gif b/app_odoo_customize/static/description/banner.gif
index 00ebe9b2..b1ab4685 100644
Binary files a/app_odoo_customize/static/description/banner.gif and b/app_odoo_customize/static/description/banner.gif differ
diff --git a/app_odoo_customize/static/description/cnreadme.png b/app_odoo_customize/static/description/cnreadme.png
index 8e3f3f6c..f990fbc6 100644
Binary files a/app_odoo_customize/static/description/cnreadme.png and b/app_odoo_customize/static/description/cnreadme.png differ
diff --git a/app_odoo_customize/static/description/index.html b/app_odoo_customize/static/description/index.html
index 7024716a..c89e9754 100644
--- a/app_odoo_customize/static/description/index.html
+++ b/app_odoo_customize/static/description/index.html
@@ -47,7 +47,12 @@
This is a Long Term Support Apps.
-
Update: v16.23.05.24
+
Update: v16.23.08.15
+
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.
+
Update: v16.23.07.25
+
42. Add menu navbar setup for top or bottom. navigator footer support.
+
Update: v16.23.07.14
41. Fix odoo bug, when click Preferences menu not hide in mobile.
Update: v16.23.05.04
Fix bug in mobile view in popup menu.
diff --git a/app_odoo_customize/views/app_theme_config_settings_views.xml b/app_odoo_customize/views/app_theme_config_settings_views.xml
index 248e6a62..9aaadffe 100644
--- a/app_odoo_customize/views/app_theme_config_settings_views.xml
+++ b/app_odoo_customize/views/app_theme_config_settings_views.xml
@@ -29,6 +29,14 @@
+
+
+
+
+
+
+
+