mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
Merge branch '10.0'
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
import ir_ui_view
|
||||
import app_theme_config_settings
|
||||
import base_language_install
|
||||
import mail_thread
|
||||
|
||||
@@ -24,6 +24,7 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
app_show_enterprise = fields.Boolean('Show Enterprise Tag', help=u"Uncheck to hide the Enterprise tag")
|
||||
app_show_share = fields.Boolean('Show Share Dashboard', help=u"Uncheck to hide the Odoo Share Dashboard")
|
||||
app_show_poweredby = fields.Boolean('Show Powered by Odoo', help=u"Uncheck to hide the Powered by text")
|
||||
app_stop_subscribe = fields.Boolean('Stop Odoo Subscribe(Performance Improve)', help=u"Check to stop Odoo Subscribe function")
|
||||
|
||||
app_documentation_url = fields.Char('Documentation Url')
|
||||
app_documentation_dev_url = fields.Char('Developer Documentation Url')
|
||||
@@ -45,6 +46,7 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
app_show_enterprise = True if ir_config.get_param('app_show_enterprise') == "True" else False
|
||||
app_show_share = True if ir_config.get_param('app_show_share') == "True" else False
|
||||
app_show_poweredby = True if ir_config.get_param('app_show_poweredby') == "True" else False
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False
|
||||
|
||||
app_documentation_url = ir_config.get_param('app_documentation_url',
|
||||
default='http://www.sunpop.cn/documentation/user/10.0/en/index.html')
|
||||
@@ -64,6 +66,8 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
app_show_enterprise=app_show_enterprise,
|
||||
app_show_share=app_show_share,
|
||||
app_show_poweredby=app_show_poweredby,
|
||||
app_stop_subscribe=app_stop_subscribe,
|
||||
|
||||
app_documentation_url=app_documentation_url,
|
||||
app_documentation_dev_url=app_documentation_dev_url,
|
||||
app_support_url=app_support_url,
|
||||
@@ -85,6 +89,7 @@ class AppThemeConfigSettings(models.TransientModel):
|
||||
ir_config.set_param("app_show_enterprise", self.app_show_enterprise or "False")
|
||||
ir_config.set_param("app_show_share", self.app_show_share or "False")
|
||||
ir_config.set_param("app_show_poweredby", self.app_show_poweredby or "False")
|
||||
ir_config.set_param("app_stop_subscribe", self.app_stop_subscribe or "False")
|
||||
|
||||
ir_config.set_param("app_documentation_url",
|
||||
self.app_documentation_url or "http://www.sunpop.cn/documentation/user/10.0/en/index.html")
|
||||
|
||||
3
app_odoo_customize/models/mail_follower.py
Normal file
3
app_odoo_customize/models/mail_follower.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Jarvis (www.odoomod.com)
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||
39
app_odoo_customize/models/mail_thread.py
Normal file
39
app_odoo_customize/models/mail_thread.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Jarvis (www.odoomod.com)
|
||||
# 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"
|
||||
|
||||
@api.multi
|
||||
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None, force=True):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return
|
||||
else:
|
||||
return super(MailThread, self).message_subscribe(partner_ids, channel_ids, subtype_ids, force)
|
||||
|
||||
@api.multi
|
||||
def message_auto_subscribe(self, updated_fields, values=None):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return
|
||||
else:
|
||||
return super(MailThread, self).message_auto_subscribe(updated_fields, values)
|
||||
|
||||
@api.multi
|
||||
def _message_auto_subscribe_notify(self, partner_ids):
|
||||
""" 停用订阅功能. """
|
||||
ir_config = self.env['ir.config_parameter']
|
||||
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False
|
||||
if app_stop_subscribe:
|
||||
return
|
||||
else:
|
||||
return super(MailThread, self)._message_auto_subscribe_notify(partner_ids)
|
||||
Reference in New Issue
Block a user