diff --git a/addons/ospp_base/__manifest__.py b/addons/ospp_base/__manifest__.py index 4641a9a..242e305 100644 --- a/addons/ospp_base/__manifest__.py +++ b/addons/ospp_base/__manifest__.py @@ -30,6 +30,14 @@ 'views/views.xml', 'views/templates.xml', ], + + 'assets': { + 'web.assets_backend': [ + 'ospp_base/static/src/js/web_title.js', + 'ospp_base/static/src/js/user_menu.js' + ], + }, + # only loaded in demonstration mode 'demo': [ 'demo/demo.xml', diff --git a/addons/ospp_base/models/models.py b/addons/ospp_base/models/models.py index e4eaadf..0601dc5 100644 --- a/addons/ospp_base/models/models.py +++ b/addons/ospp_base/models/models.py @@ -4,6 +4,19 @@ import uuid from odoo import models, fields, api, _ +class View(models.Model): + _inherit = 'ir.ui.view' + + @api.model + def _render_template(self, template, values=None): + if template in ['web.login', 'web.webclient_bootstrap']: + if not values: + values = {} + values["title"] = _("Newbiz") + values["disable_footer"] = self.env['ir.config_parameter'].sudo().get_param("disable_footer", "") or True + return super(View, self)._render_template(template, values) + + class ResPartner(models.Model): _inherit = 'res.partner' diff --git a/addons/ospp_base/static/description/icon.png b/addons/ospp_base/static/description/icon.png new file mode 100755 index 0000000..f2bde0a Binary files /dev/null and b/addons/ospp_base/static/description/icon.png differ diff --git a/addons/ospp_base/static/description/icon_timing.png b/addons/ospp_base/static/description/icon_timing.png new file mode 100755 index 0000000..8dc6fcc Binary files /dev/null and b/addons/ospp_base/static/description/icon_timing.png differ diff --git a/addons/ospp_base/static/src/img/favicon.png b/addons/ospp_base/static/src/img/favicon.png new file mode 100644 index 0000000..7885a52 Binary files /dev/null and b/addons/ospp_base/static/src/img/favicon.png differ diff --git a/addons/ospp_base/static/src/img/logo.svg b/addons/ospp_base/static/src/img/logo.svg new file mode 100644 index 0000000..4c4de65 --- /dev/null +++ b/addons/ospp_base/static/src/img/logo.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 数字实训 + + + + \ No newline at end of file diff --git a/addons/ospp_base/static/src/js/user_menu.js b/addons/ospp_base/static/src/js/user_menu.js new file mode 100755 index 0000000..fc71427 --- /dev/null +++ b/addons/ospp_base/static/src/js/user_menu.js @@ -0,0 +1,43 @@ +/** @odoo-module **/ + +import { registry } from "@web/core/registry"; +import { preferencesItem } from "@web/webclient/user_menu/user_menu_items"; +import {browser} from "@web/core/browser/browser"; + +function documentationItem1(env) { + const documentationURL = "https://www.newbizpaas.cn/documentation"; + return { + type: "item", + id: "documentation1", + description: env._t("Documentation"), + href: documentationURL, + callback: () => { + browser.open(documentationURL, "_blank"); + }, + sequence: 10, + }; +} + +function supportItem1(env) { + const supportURL = "https://www.newbizpaas.cn/forum/1"; + return { + type: "item", + id: "support1", + description: env._t("Support"), + href: supportURL, + callback: () => { + browser.open(supportURL, "_blank"); + }, + sequence: 20, + }; +} + + +registry.category("user_menuitems").remove('documentation', { force: true }) +registry.category("user_menuitems").add('documentation1', documentationItem1) + +registry.category("user_menuitems").remove('support', { force: true }) +registry.category("user_menuitems").add('support1', supportItem1) + + +registry.category("user_menuitems").remove('odoo_account', { force: true }) diff --git a/addons/ospp_base/static/src/js/web_title.js b/addons/ospp_base/static/src/js/web_title.js new file mode 100755 index 0000000..dd9e2de --- /dev/null +++ b/addons/ospp_base/static/src/js/web_title.js @@ -0,0 +1,15 @@ +/** @odoo-module **/ + +import { WebClient } from "@web/webclient/webclient"; +import {patch} from "@web/core/utils/patch"; + +var core = require('web.core'); +var _lt = core._lt; + +patch(WebClient.prototype, "Web Window Title", { + setup() { + const title = _lt("Newbiz"); + this._super(); + this.title.setParts({ zopenerp: title }); + } +});