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.

2

How to hide a button in tree view?

By
John
on 2/12/15, 11:54 AM 1,033 views

I need to hide a button in tree view(one2many) but only in non-editable mode. I have tried class="oe_edit_only" but it doesn't work.


NOTE : I need to hide only in non-editable mode NOT in editable mode. Please don't suggest and mark invisible = "1" as correct answer.
Any help would be appreciated.
Thank You :)

That's a good question, I have de same problem. Could you find a solution?

Gabriel
on 9/8/15, 11:06 AM

A related bug is referenced: https://bugs.launchpad.net/openerp-web/+bug/1311199

Gabriel
on 9/8/15, 11:07 AM
2
Yogesh
On 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.
 

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

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

1
John
On 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.
 

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

1 follower(s)

Stats

Asked: 2/12/15, 11:54 AM
Seen: 1033 times
Last updated: 9/8/15, 11:07 AM