odoo.define('app_odoo_customize.UserMenu', function (require) { "use strict"; /** * This widget is appended by the webclient to the right of the navbar. * It displays the avatar and the name of the logged user (and optionally the * db name, in debug mode). * If clicked, it opens a dropdown allowing the user to perform actions like * editing its preferences, accessing the documentation, logging out... */ const session = require('web.session'); var UserMenu = require('web.UserMenu'); //避免错误,要再定义 var documentation_url = 'https://www.sunpop.cn'; var documentation_dev_url = 'https://www.sunpop.cn'; var support_url = 'https://www.sunpop.cn'; var account_title = 'My Account'; var account_url = 'https://www.sunpop.cn'; UserMenu.include({ init: function () { this._super.apply(this, arguments); var self = this; var session = this.getSession(); var lang_list = ''; self.is_manager = false; self.show_debug = false; self._rpc({ model: 'res.lang', method: 'search_read', domain: [], fields: ['name', 'code'], lazy: false, }).then(function (res) { _.each(res, function (lang) { var a = ''; if (lang['code'] === session.user_context.lang) { a = ''; } else { a = ''; } lang_list += '' + lang['name'] + a + ''; }); lang_list += '