Odoo Help

3

0
6 Answers
3
Avatar

Yogesh India

--Yogesh--

1069
| 5 3 10
Delhi, India
--Yogesh--

Nothing to say .... :)

Yogesh India
2/27/15, 9:34 AM

It is not perfect solution but work around to what you want to achieve:
Odoo gives us two classes

  1. 'oe_edit_only' : to show element in edit mode only
  2. 'oe_read_only' : to show element in read mode only

so I defined a duplicate field of my one2many field and show that in only read mode and original only in edit mode.
Note: we can not use same field in xml more than one time because odoo populates value only in lastly defined field. all previous fields with same name remain blank.
 

2 Comments
GLOBAL CREATIVE CONCEPTS TECH CO LTD - iWesabe Saudi Arabia
4/26/18, 12:38 AM

+1

Andres Brigard Colombia
10/19/18, 5:42 PM

I have tried with field and buttons in tree view inside a form of the parent entity and none of them are hidden in read mode.

<field name="status_acta" class="oe_edit_only"/>

<button name="pickup_units" type="object" string="Pick Up" class="oe_edit_only" attrs="{'invisible':['|','|', ('type','!=','acta_ant'),('activo','=',False),('status_acta','!=','sent')]}"/>

1
Giovanny Vizcaya Venezuela
2/12/15, 1:57 PM

Try writting invisible="True" in the button xml line, i think it works

1
John Brazil
2/12/15, 3:11 PM

@Giovanny: I wanted to leave comment but this website is not allowing me to do so. but with your solution button will be hidden permanently. I need to hide only in Non-Editable mode.
 

0
Timothy Stonis China
4/25/18, 1:56 PM

You can pass the class to the template by finding the button template "ListView.row.button" in addons/web/static/src/xml/base.xml. Just add "#{widget.class}" to the button t-attf-class attribute. 

Ask a Question
Writer
218
John
Tag
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now