私はフォームビューを継承し、xpathを使用していくつかの変更を加えました。管理者だけに表示するために、フォームビューのヘッダーにボタンが必要です。私はグループを入れているときには、その寄付は、次のエラー:特定のユーザ(管理者)のボタンを表示中にエラーが発生しましたodo 8
エラーの詳細:
私のコードは次のとおりです。
<record id="wms_stock_view_move_form" model="ir.ui.view">
<field name="name">wms.stock.view.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<field name="location_id" position="attributes">
<attribute name="domain">[('name','!=', 'Scrapped')]</attribute>
</field>
<field name="location_dest_id" position="attributes">
<attribute name="domain">[('name','!=', 'Scrapped')]</attribute>
</field>
<xpath expr='//form[@string="Stock Moves"]' position='attributes'>
<attribute name="create">false</attribute>
<attribute name="edit">false</attribute>
<attribute name="delete">false</attribute>
</xpath>
<xpath expr='//button[@name="action_cancel"]' position='attributes'>
<attribute name="invisible">True</attribute>
</xpath>
<button name="action_done" states="draft,assigned,confirmed" string="Process Entirely" type="object" class="oe_highlight" position="replace" groups="base.group_no_one"/>
</field>
</record>
前のコードでは、管理者グループを追加しました。しかしここでカスタムグループを追加しましたか? –
はい、それは私のタイプミスでした。私は今修正しました:) – odoobeginner
他の(拡張子)ビューの変更が失われる可能性があるため、ボタン全体を置き換えることはありません。 – CZoellner