首页 > 解决方案 > 如何在不编码的情况下从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>

标签: odoo

解决方案


推荐阅读