Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2306 Представления

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
окт. 21
2666
2
нояб. 17
6975
1
апр. 25
4572
2
авг. 24
9870
0
дек. 23
1063