【发布时间】:2021-06-27 20:09:58
【问题描述】:
我想让模型“account.move”中的“Reset To Draft”按钮仅对'account.group_account_invoice'可见,也就是说,它应该是不可见的对于组'account.group_account_manager',这是我的代码;
<record id="account_move_form_view_extend" model="ir.ui.view">
<field name="name">account.move.form.view.extend</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='button_draft']" position="attributes"/>
<attribute name="groups">account.group_account_manager</attribute><xpath/>
<attribute name ="attrs=">{'invisible' : [('show_reset_to_draft_button', '=', True)]}</attribute>
</field>
</record>
但我收到了这个错误:
raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception
odoo.exceptions.ValidationError: Error while validating view:
Element '<attribute name="groups">' cannot be located in parent view
View name: account.move.form.view.extend
请问怎么了?我该怎么做 ? 谢谢。
【问题讨论】:
-
你在这一行犯了错误 -
account.group_account_manager 。您必须在第二个属性标记完成后关闭 。
标签: javascript python xml odoo