diff --git a/app_odoo_customize/__manifest__.py b/app_odoo_customize/__manifest__.py index a5f93cd3..0ab3bae1 100644 --- a/app_odoo_customize/__manifest__.py +++ b/app_odoo_customize/__manifest__.py @@ -62,7 +62,7 @@ The user can get the help document just by one click. 'depends': ['base', 'web', 'mail'], 'data': [ 'views/app_odoo_customize_view.xml', - 'views/app_theme_config_settings_view.xml', + # 'views/app_theme_config_settings_view.xml', 'views/ir_model_view.xml', # data 'data/ir_config_parameter.xml', diff --git a/app_odoo_customize/static/src/js/customize_user_menu.js b/app_odoo_customize/static/src/js/customize_user_menu.js index e6b6787a..58ca2d27 100644 --- a/app_odoo_customize/static/src/js/customize_user_menu.js +++ b/app_odoo_customize/static/src/js/customize_user_menu.js @@ -12,10 +12,10 @@ odoo.define('app_odoo_customize.UserMenu', function (require) { var UserMenu = require('web.UserMenu'); //避免错误,要再定义 var documentation_url = 'http://www.sunpop.cn'; - var documentation_dev_url; - var support_url; - var account_title; - var account_url; + var documentation_dev_url = 'http://www.sunpop.cn'; + var support_url = 'http://www.sunpop.cn'; + var account_title = 'My Account'; + var account_url = 'http://www.sunpop.cn'; UserMenu.include({ init: function () { @@ -38,60 +38,61 @@ odoo.define('app_odoo_customize.UserMenu', function (require) { } else { a = ''; } - lang_list += '
' + lang['name'] + a + '
' + lang['name'] + a + '';
});
- lang_list += '';
+ lang_list += '';
$('switch-lang').replaceWith(lang_list);
})
//取参数
- self._rpc({
- model: 'ir.config_parameter',
- method: 'search_read',
- domain: [['key', '=like', 'app_%']],
- fields: ['key', 'value'],
- lazy: false,
- }).then(function (res) {
- $.each(res, function (key, val) {
- if (val.key == 'app_documentation_url')
- documentation_url = val.value;
- if (val.key == 'app_documentation_dev_url')
- documentation_dev_url = val.value;
- if (val.key == 'app_support_url')
- support_url = val.value;
- if (val.key == 'app_account_title')
- account_title = val.value;
- if (val.key == 'app_account_url')
- account_url = val.value;
- // 控制显示
- if (val.key == 'app_show_lang' && val.value == "False") {
- $('switch-lang').hide();
- }
- if (session.user_context.uid!=1 || (val.key == 'app_show_debug' && val.value == "False")) {
- $('[data-menu="debug"]').parent().hide();
- $('[data-menu="debugassets"]').parent().hide();
- $('[data-menu="quitdebug"]').parent().hide();
- }
- if (val.key == 'app_show_documentation' && val.value == "False") {
- $('[data-menu="documentation"]').parent().hide();
- }
- if (val.key == 'app_show_documentation_dev' && val.value == "False") {
- $('[data-menu="documentation_dev"]').parent().hide();
- }
- if (val.key == 'app_show_support' && val.value == "False") {
- $('[data-menu="support"]').parent().hide();
- }
- if (val.key == 'app_show_account' && val.value == "False") {
- $('[data-menu="account"]').parent().hide();
- }
- if (val.key == 'app_account_title' && val.value) {
- $('[data-menu="account"]').html(account_title);
- }
- if (val.key == 'app_show_poweredby' && val.value == "False") {
- $('.o_sub_menu_footer').hide();
- }
- });
- })
+ // self._rpc({
+ // model: 'ir.config_parameter',
+ // method: 'search_read',
+ // domain: [['key', '=like', 'app_%']],
+ // fields: ['key', 'value'],
+ // lazy: false,
+ // }).then(function (res) {
+ // $.each(res, function (key, val) {
+ // if (val.key == 'app_documentation_url')
+ // documentation_url = val.value;
+ // if (val.key == 'app_documentation_dev_url')
+ // documentation_dev_url = val.value;
+ // if (val.key == 'app_support_url')
+ // support_url = val.value;
+ // if (val.key == 'app_account_title')
+ // account_title = val.value;
+ // if (val.key == 'app_account_url')
+ // account_url = val.value;
+ // // 控制显示
+ // if (val.key == 'app_show_lang' && val.value == "False") {
+ // $('switch-lang').hide();
+ // }
+ // if (session.user_context.uid!=1 || (val.key == 'app_show_debug' && val.value == "False")) {
+ // $('[data-menu="debug"]').parent().hide();
+ // $('[data-menu="debugassets"]').parent().hide();
+ // $('[data-menu="quitdebug"]').parent().hide();
+ // }
+ // if (val.key == 'app_show_documentation' && val.value == "False") {
+ // $('[data-menu="documentation"]').parent().hide();
+ // }
+ // if (val.key == 'app_show_documentation_dev' && val.value == "False") {
+ // $('[data-menu="documentation_dev"]').parent().hide();
+ // }
+ // if (val.key == 'app_show_support' && val.value == "False") {
+ // $('[data-menu="support"]').parent().hide();
+ // }
+ // if (val.key == 'app_show_account' && val.value == "False") {
+ // $('[data-menu="account"]').parent().hide();
+ // }
+ // if (val.key == 'app_account_title' && val.value) {
+ // $('[data-menu="account"]').html(account_title);
+ // }
+ // if (val.key == 'app_show_poweredby' && val.value == "False") {
+ // $('.o_sub_menu_footer').hide();
+ // }
+ // });
+ // })
},
/**
* @override
@@ -101,7 +102,7 @@ odoo.define('app_odoo_customize.UserMenu', function (require) {
var self = this;
return this._super.apply(this, arguments).then(function () {
//语言切换特殊处理
- self.$el.on('click', 'li a[data-lang-menu]', function (ev) {
+ self.$el.on('click', 'a[data-lang-menu]', function (ev) {
ev.preventDefault();
var f = self['_onMenuLang']
f.call(self, $(this));
@@ -113,11 +114,11 @@ odoo.define('app_odoo_customize.UserMenu', function (require) {
if (window.location.href.indexOf('debug=assets') != -1)
mMode = 'assets';
if (mMode == 'normal')
- $('[data-menu="quitdebug"]').parent().hide();
+ $('[data-menu="quitdebug"]').hide();
if (mMode == 'debug')
- $('[data-menu="debug"]').parent().hide();
+ $('[data-menu="debug"]').hide();
if (mMode == 'assets')
- $('[data-menu="debugassets"]').parent().hide();
+ $('[data-menu="debugassets"]').hide();
});
},
_onMenuAccount: function () {
diff --git a/app_odoo_customize/static/src/xml/customize_user_menu.xml b/app_odoo_customize/static/src/xml/customize_user_menu.xml
index c38be194..8662379b 100644
--- a/app_odoo_customize/static/src/xml/customize_user_menu.xml
+++ b/app_odoo_customize/static/src/xml/customize_user_menu.xml
@@ -1,21 +1,13 @@