mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix app
This commit is contained in:
@@ -40,7 +40,7 @@ msgid "All Business"
|
|||||||
msgstr "所有业务"
|
msgstr "所有业务"
|
||||||
|
|
||||||
#. module: app_odoo_customize
|
#. module: app_odoo_customize
|
||||||
#: model:ir.model,name:app_odoo_customize.model_app_theme_config_settings
|
#: model:ir.model,name:app_odoo_customize.model_res_config_settings
|
||||||
msgid "App Odoo Customize settings"
|
msgid "App Odoo Customize settings"
|
||||||
msgstr "App Odoo 自定义设置"
|
msgstr "App Odoo 自定义设置"
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ from odoo import api, fields, models, _
|
|||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AppThemeConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
_inherit = 'res.config.settings'
|
_inherit = 'res.config.settings'
|
||||||
_name = 'app.theme.config.settings'
|
|
||||||
|
|
||||||
_description = u"App Odoo Customize settings"
|
_description = u"App Odoo Customize settings"
|
||||||
app_system_name = fields.Char('System Name', help=u"Setup System Name,which replace Odoo")
|
app_system_name = fields.Char('System Name', help=u"Setup System Name,which replace Odoo")
|
||||||
@@ -38,28 +37,29 @@ class AppThemeConfigSettings(models.TransientModel):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_values(self):
|
def get_values(self):
|
||||||
ir_config = self.env['ir.config_parameter']
|
res = super(ResConfigSettings, self).get_values()
|
||||||
app_system_name = ir_config.sudo().get_param('app_system_name', default='odooApp')
|
ir_config = self.env['ir.config_parameter'].sudo()
|
||||||
|
app_system_name = ir_config.get_param('app_system_name', default='odooApp')
|
||||||
|
|
||||||
app_show_lang = True if ir_config.sudo().get_param('app_show_lang') == "True" else False
|
app_show_lang = True if ir_config.get_param('app_show_lang') == "True" else False
|
||||||
app_show_debug = True if ir_config.sudo().get_param('app_show_debug') == "True" else False
|
app_show_debug = True if ir_config.get_param('app_show_debug') == "True" else False
|
||||||
app_show_documentation = True if ir_config.sudo().get_param('app_show_documentation') == "True" else False
|
app_show_documentation = True if ir_config.get_param('app_show_documentation') == "True" else False
|
||||||
app_show_documentation_dev = True if ir_config.sudo().get_param('app_show_documentation_dev') == "True" else False
|
app_show_documentation_dev = True if ir_config.get_param('app_show_documentation_dev') == "True" else False
|
||||||
app_show_support = True if ir_config.sudo().get_param('app_show_support') == "True" else False
|
app_show_support = True if ir_config.get_param('app_show_support') == "True" else False
|
||||||
app_show_account = True if ir_config.sudo().get_param('app_show_account') == "True" else False
|
app_show_account = True if ir_config.get_param('app_show_account') == "True" else False
|
||||||
app_show_enterprise = True if ir_config.sudo().get_param('app_show_enterprise') == "True" else False
|
app_show_enterprise = True if ir_config.get_param('app_show_enterprise') == "True" else False
|
||||||
app_show_share = True if ir_config.sudo().get_param('app_show_share') == "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.sudo().get_param('app_show_poweredby') == "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.sudo().get_param('app_stop_subscribe') == "True" else False
|
app_stop_subscribe = True if ir_config.get_param('app_stop_subscribe') == "True" else False
|
||||||
|
|
||||||
app_documentation_url = ir_config.sudo().get_param('app_documentation_url',
|
app_documentation_url = ir_config.get_param('app_documentation_url',
|
||||||
default='http://www.sunpop.cn/documentation/user/10.0/en/index.html')
|
default='http://www.sunpop.cn/documentation/user/10.0/en/index.html')
|
||||||
app_documentation_dev_url = ir_config.sudo().get_param('app_documentation_dev_url',
|
app_documentation_dev_url = ir_config.get_param('app_documentation_dev_url',
|
||||||
default='http://www.sunpop.cn/documentation/10.0/index.html')
|
default='http://www.sunpop.cn/documentation/10.0/index.html')
|
||||||
app_support_url = ir_config.sudo().get_param('app_support_url', default='http://www.sunpop.cn/trial/')
|
app_support_url = ir_config.get_param('app_support_url', default='http://www.sunpop.cn/trial/')
|
||||||
app_account_title = ir_config.sudo().get_param('app_account_title', default='My Online Account')
|
app_account_title = ir_config.get_param('app_account_title', default='My Online Account')
|
||||||
app_account_url = ir_config.sudo().get_param('app_account_url', default='http://www.sunpop.cn/my-account/')
|
app_account_url = ir_config.get_param('app_account_url', default='http://www.sunpop.cn/my-account/')
|
||||||
return dict(
|
res.update(
|
||||||
app_system_name=app_system_name,
|
app_system_name=app_system_name,
|
||||||
app_show_lang=app_show_lang,
|
app_show_lang=app_show_lang,
|
||||||
app_show_debug=app_show_debug,
|
app_show_debug=app_show_debug,
|
||||||
@@ -78,10 +78,11 @@ class AppThemeConfigSettings(models.TransientModel):
|
|||||||
app_account_title=app_account_title,
|
app_account_title=app_account_title,
|
||||||
app_account_url=app_account_url
|
app_account_url=app_account_url
|
||||||
)
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def set_values(self):
|
def set_values(self):
|
||||||
self.ensure_one()
|
super(ResConfigSettings, self).set_values()
|
||||||
ir_config = self.env['ir.config_parameter']
|
ir_config = self.env['ir.config_parameter']
|
||||||
ir_config.set_param("app_system_name", self.app_system_name or "")
|
ir_config.set_param("app_system_name", self.app_system_name or "")
|
||||||
ir_config.set_param("app_show_lang", self.app_show_lang or "False")
|
ir_config.set_param("app_show_lang", self.app_show_lang or "False")
|
||||||
@@ -103,8 +104,6 @@ class AppThemeConfigSettings(models.TransientModel):
|
|||||||
ir_config.set_param("app_account_title", self.app_account_title or "My Online Account")
|
ir_config.set_param("app_account_title", self.app_account_title or "My Online Account")
|
||||||
ir_config.set_param("app_account_url", self.app_account_url or "http://www.sunpop.cn/my-account/")
|
ir_config.set_param("app_account_url", self.app_account_url or "http://www.sunpop.cn/my-account/")
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def remove_sales(self):
|
def remove_sales(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<data>
|
<data>
|
||||||
<record id="view_app_theme_config_settings" model="ir.ui.view">
|
<record id="view_app_theme_config_settings" model="ir.ui.view">
|
||||||
<field name="name">App Odoo Customize Settings</field>
|
<field name="name">App Odoo Customize Settings</field>
|
||||||
<field name="model">app.theme.config.settings</field>
|
<field name="model">res.config.settings</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="odooApp Customize Settings" class="oe_form_configuration">
|
<form string="odooApp Customize Settings" class="oe_form_configuration">
|
||||||
<header>
|
<header>
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
<record id="action_app_theme_config" model="ir.actions.act_window">
|
<record id="action_app_theme_config" model="ir.actions.act_window">
|
||||||
<field name="name">odooApp Customize</field>
|
<field name="name">odooApp Customize</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">app.theme.config.settings</field>
|
<field name="res_model">res.config.settings</field>
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">inline</field>
|
<field name="target">inline</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user