跳至内容
菜单
此问题已终结
1 回复
2159 查看

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
2505
2
11月 17
6776
1
4月 25
4379
2
8月 24
9542
0
12月 23
962