我需要在sale.order表单视图中替换一个窗口操作的按钮功能,以使某个用户可以看到按钮。如何实现。
这是要替换的按钮功能:
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
答案 0 :(得分:0)
ListView
I think you need to inherit the action in the button
继承的行动:
使用模块名称购买呼叫操作
<record id="action_view_sale_advance_payment_inv" model="ir.actions.act_window">
<field name="name">Invoice Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.advance.payment.inv</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="groups_id" eval="[(4,ref('base.group_sale_salesman'))]"/>
</record>
然后你可以在group_id中给出某个组