隐藏odoo特有

隐藏导入数据时,多余的内容

xml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
    <t t-inherit="base_import.ImportAction" t-inherit-mode="extension" owl="1">
        <xpath expr="//div[hasclass('mt16')]" position="replace"></xpath>
        <xpath expr="//div[@t-foreach]" position="replace"></xpath>
        <xpath expr="//a[@target='new']" position="replace"></xpath>
    </t>
    <t t-inherit="base_import.ImportDataSidepanel" t-inherit-mode="extension" owl="1">
        <xpath expr="//h4[text()='Help']/.." position="replace"></xpath>
    </t>
</templates>

隐藏右上角 ActivityMenu

xml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
    <t t-inherit="mail.ActivityMenu" t-inherit-mode="extension" owl="1">
        <xpath expr="//Dropdown[hasclass('discussSystray.class')]" position="replace"></xpath>
    </t>
    <t t-inherit="mail.MessagingMenu" t-inherit-mode="extension" owl="1">
        <xpath expr="//t[@ t-set-slot='toggler']" position="replace"></xpath>
    </t>
</templates>

隐藏字段伸缩展示、隐藏功能

当这里有值时,就显示,没有值时,就隐藏

隐藏 右上角 个人展开的一些菜单

javascript 复制代码
/** @odoo-module **/

import { UserMenu } from "@web/webclient/user_menu/user_menu";
import { patch } from "@web/core/utils/patch";
import { registry } from "@web/core/registry";
const userMenuRegistry = registry.category("user_menuitems");

patch(UserMenu.prototype, {
    setup() {
        super.setup();
        userMenuRegistry.remove("documentation");
        userMenuRegistry.remove("support");
        userMenuRegistry.remove("shortcuts");
        userMenuRegistry.remove("separator");
        userMenuRegistry.remove("odoo_account");
    }
});
相关推荐
敲代码的嘎仔2 分钟前
实习日志day6--实习日志day6--title命名规范化&businessType纠正&补充缺失的@Log注解&报警与通信模块补充&产出阶段总结文档
java·开发语言·人工智能·git·python·实习·大二
江华森20 分钟前
Python 实现高德地图找房(一):环境搭建与数据爬虫
开发语言·爬虫·python
VIP_CQCRE1 小时前
用 Ace Data Cloud 快速接入 OpenAI Chat Completions:对话、流式、多轮和多模态一篇打通
python·ai·openai·api·教程
老迟到的茉莉2 小时前
Hermes 是谁?跟 Claude Code 差在哪
开发语言·python
Day(AKA Elin)2 小时前
【Day】MTP(Multi Token Prediction)技术学习
python·深度学习·学习·llama
程序员小远3 小时前
接口测试之文件上传
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·接口测试
江华森3 小时前
Python 实现高德地图找房(三):地图可视化与高德 JS API
开发语言·javascript·python
曲幽4 小时前
Anki插件开发必知必会:钩子函数与右键菜单定制
python·fastapi·anki·menu·browser·addons
技术工小李4 小时前
现场评分系统|景泰2026“农创客”杯大赛实战应用宣传
python
天天进步20154 小时前
Python全栈项目--基于Python的网络监控工具
开发语言·网络·python