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:
@@ -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)
|
||||
@@ -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%')
|
||||
|
||||
Reference in New Issue
Block a user