odoo - 如何在不编码的情况下从odoo的视图中隐藏“批准”按钮?
问题描述
拜托,我需要隐藏“要批准的费用报告”视图中的“批准”按钮而不进行任何代码更改,我使用 odoo 11,并且我安装的模块是 hr_expense。以下是此视图的部分代码:
<form string="Expense Reports" class="o_expense_sheet" modifiers="{}">
<header modifiers="{}">
<button name="approve_expense_sheets" states="submit" string="Approve" type="object" class="oe_highlight o_expense_sheet_approve" modifiers="{'invisible':[['state','not in',['submit']]]}" options="{}"/>
<button name="action_sheet_move_create" states="approve" string="Post Journal Entries" type="object" class="oe_highlight o_expense_sheet_post" modifiers="{'invisible':[['state','not in',['approve']]]}" options="{}"/>
<button name="248" type="action" string="Register Payment" class="oe_highlight o_expense_sheet_pay" attrs="{'invisible': [('state', '!=', 'post')]}" context="{'default_amount': total_amount, 'partner_id': address_id}" modifiers="{'invisible':[['state','!=','post']]}" options="{}"/>
<button name="reset_expense_sheets" states="cancel" string="Resubmit" type="object" modifiers="{'invisible':[['state','not in',['cancel']]]}" options="{}"/>
<button name="247" states="submit,approve" context="{'hr_expense_refuse_model':'hr.expense.sheet'}" string="Refuse" type="action" modifiers="{'invisible':[['state','not in',['submit','approve']]]}" options="{}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,submit,approve,post,done" on_change="1" modifiers="{'readonly':true,'required':true}"/>
</header>
<sheet modifiers="{}">
<div class="oe_button_box" modifiers="{}">
<button name="action_get_attachment_view" class="oe_stat_button" icon="fa-book" type="object" modifiers="{}" options="{}">
<field name="attachment_number" widget="statinfo" string="Documents" modifiers="{'readonly':true}"/>
</button>
</div>
解决方案
推荐阅读
- amazon-web-services - Flutter 无法使用 Web Socket Channel 连接到 AWS
- javascript - 访问输入数组中的特定输入
- python - 如何从所有列的列表中删除 nan 并将某些包含列表的列转换为字符串和 int?
- android - 如何将 Activity 类中的 finish() 作为函数参数传递(这样代码可以在 Kotlin 中重用)?
- javascript - 创建将当前年/月/日/小时插入 URL 的 javascript 小书签?
- python - Flask – 具有共享功能的多个子域
- android - 如何使用勺子运行特定的浓缩咖啡测试类/测试用例?
- python - 为什么我会收到 ConnectionResetError: [WinError 10054] 现有连接被远程主机强行关闭?
- javascript - Graphql 突变正在覆盖现有数据
- textures - 使用 BIM 360 时,添加材料以提高性能的最佳位置是什么?