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

I need to make this field read-only. I have set it as such in the Studio, but unfortunately it makes it read-only for just me. How can I make this read-only for all users?


Odoo SH v17

Avatar
Annuleer

Hi,
Not sure how you make it readonly in the first place:

* Enable studio
* Click on the field
* From the studio options, tick readonly

Thanks

Auteur

That’s what I did add it’s only read only for me

Beste antwoord

Hi,

You can make the "Cost" field (standard_price) read-only for all users using both

1. By using Studio


You can also set it based on a condition


2. By using Code


<record id="product_template_form_view_inherit_readonly_cost"
model="ir.ui.view">
<field name="name">product.template.form.readonly.cost</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
</field>
</record>

 Hope it helps.

Avatar
Annuleer