I want the status record to be uneditable if state = active, done
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Hi,
In Odoo 17, to make a field (like status) read-only when the record’s state is either "active" or "done" You can achieve this using the 'readonly' attribute in the XML view, or by using Python logic with @api.depends and readonly=True on the field.
XML
<field name="status" readonly="state in ['active', 'done']"/>
Hope it helps
is this you need for particular users or all users ( not to edit record - only view)
i want to all fields in record to be uneditable
Use the following code in your XML:
field name="state" readonly="state in ['active', 'done']"
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
0
août 25
|
175 | ||
|
1
août 25
|
620 | ||
Change position chatter
Résolu
|
|
1
août 25
|
505 | |
|
4
juil. 25
|
1846 | ||
|
1
juil. 25
|
1054 |