隐藏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");
    }
});
相关推荐
lifewange1 小时前
pytest 找不到文件?直接在 pytest.ini 配置根目录 + 路径(最简单方案)
开发语言·python·pytest
yuanpan1 小时前
Python 桌面 GUI 入门开发:从 tkinter 窗口到简易记事本
开发语言·python
川石课堂软件测试1 小时前
软件测试|常见面试题整理
数据库·python·jmeter·mysql·appium·postman·prometheus
做个文艺程序员1 小时前
Multi-Agent 系统实战:用 Python + LangGraph 搭建多智能体协作工作流
python·多智能体·langgraph·multi-agent
bang冰冰2 小时前
Trae工具安装和使用教程(新手零基础入门,全程无坑)
java·人工智能·python
User_芊芊君子2 小时前
聊聊自由开发者常用的学习机会全解析
开发语言·人工智能·python
weixin_376593223 小时前
使用pyhon脚本方式将超链接保存到第一列以数字方式显示
python
byzh_rc3 小时前
[AI编程从入门到入土] 装饰器decorator
开发语言·python·ai编程
贫民窟的勇敢爷们3 小时前
Java 与 Python 如何选型与融合
java·开发语言·python