跳至內容
選單
此問題已被標幟
1 回覆
2308 瀏覽次數

Hello 

 I need to restrict upload/create attachment from purchase order page in the state (purchase)

thank you in advance


頭像
捨棄
最佳答案

Hi Pablo,

Please try this way,


<record model="ir.ui.view" id="purchase_order_form_inherit">
    <field name="name">purchase.order.form.inherit</field>
 
  <field name="model">purchase.order</field>
    <field name="inherit_id" ref="purchase.purchase_order_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='attachment_ids']" position="attributes">
            <attribute name="attrs">{'readonly': [('state', '=', 'purchase')]}</attribute>
        </xpath>
    </field>
</record>


you can change the state to required state in which you want to set the field readonly


Hope this helps,

Regards


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 21
2666
2
11月 17
6976
1
4月 25
4573
2
8月 24
9875
0
12月 23
1063