Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to detect whether user is adding record or editing

By
Merlin TecSol Pvt. Ltd.
on 5/10/13, 3:51 AM 677 views

I need to detect when a user is in add (new) mode when the view is loaded or in edit mode.

I need this because I want to hide a few fields when the user is adding a new entry and show them when the user is editing an entry.

TIA

0

Vasiliy Birukov

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

Vasiliy Birukov
On 5/10/13, 5:40 AM

Use invisible attribut with dynamic conditions. See for example:

<field name="field1"/>
<field name="field2" attrs="{'invisible':[('field1','=','some_value')]}"/>

field2 will show or not depended from value field1.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/10/13, 3:51 AM
Seen: 677 times
Last updated: 3/16/15, 8:10 AM