Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2260 Weergaven

Hello 

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

thank you in advance


Avatar
Annuleer
Beste antwoord

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


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
okt. 21
2627
2
nov. 17
6922
1
apr. 25
4541
2
aug. 24
9793
0
dec. 23
1034