2017-12-04 3 views
2

私はxpathで請求書フォームのディスカウントフィールドを隠そうとしています。しかし、それは動作しません。請求書フォームのディスカウントフィールドを非表示にするにはどうすればいいですか? Odoo

次は私のコードです:

<odoo> 
    <data> 
    <record model="ir.ui.view" id="hidden_discount"> 
     <field name="name">account.invoice.hidden.discount</field> 
     <field name="model">account.invoice</field> 
     <field name="inherit_id" ref="account.invoice_form"/> 
     <field name="arch" type="xml"> 
     <xpath expr="//field[@name='discount']" position="attributes"> 
      <attribute name="invisible">True</attribute> 
     </xpath> 
     </field> 
    </record> 
    </data> 
</odoo> 

あなたは、任意の解決策や提案を持っていますか?

答えて

1

One2manyフィールドの直接フォームビューデザインはありません。したがって、account.invoice.lineフォームビューを直接アップグレードする必要があります。

次のコードを試してみてください。

<record model="ir.ui.view" id="hidden_discount"> 
    <field name="name">account.invoice.line.hidden.discount</field> 
    <field name="model">account.invoice.line</field> 
    <field name="inherit_id" ref="account.view_invoice_line_form"/> 
    <field name="arch" type="xml"> 
     <field name="discount" position="attributes"> 
      <attribute name="invisible">1</attribute> 
     </field> 
    </field> 
</record> 
+0

は、あなたの答えをありがとう:D は、私は、ビューであるから、他の継承ビューがありました。それはなぜそれが動作しないanwserです:( – ReiiYuki

関連する問題