Skip to Content
Menu
This question has been flagged
1 Atsakyti
2322 Rodiniai

Hello 

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

thank you in advance


Portretas
Atmesti
Best Answer

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
spal. 21
2675
2
lapkr. 17
6986
1
bal. 25
4583
2
rugp. 24
9899
0
gruod. 23
1069