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.

5

Inverse of css class oe_edit_only?

By
Attila Tatár
on 4/17/13, 4:06 AM 6,831 views

Hi, I need to have a label for editing mode and one for the non-editing mode, for same field. For editing mode there is oe_edit_only, but what is the solution for non-editing mode?

4

Hi there,

With Odoo V8, you could use the class "oe_read_only" to display your label in read mode, and "oe_edit_only" in edit mode...

This is what I use and it's working fine.

11

Parth Gajjar

--Parth Gajjar--
1484
| 3 3 5
Ahmadabad, India
--Parth Gajjar--
Parth Gajjar
On 4/17/13, 5:02 AM

There is no inverse of oe_edit_only

But if you really needs to do that then you need to edit in css file

append this to in base.css file

.openerp .oe_form_editable .oe_save_only, .openerp .oe_form_editable .oe_form_field:empty {
  display: none !important;
}

then use class oe_save_only exactly like you use oe_edit_only

Hope This will Help :)

Thank you Parth, is working!

Attila Tatár
on 4/17/13, 7:40 AM

Thank you!!

This is really an important feature!

René Schuster
on 12/17/13, 6:41 AM

Please, could someone explain to me how to add a class to a field.i tried it but it shows me an XML architecture error.do i have to do something before using it?Thank you

Soukaina SBITTI
on 3/10/14, 11:28 AM

Add given css in base.css file of web and then just add class oe_save_only on field exactly like oe_edit_only

Parth Gajjar
on 3/11/14, 9:48 AM

my problem is even the basic classes in base.css aren't recognized. when i write for example: <field name="somefield" class="oe_edit_only"> it gives me an error.i've tried everything i don't know what to do

Soukaina SBITTI
on 3/11/14, 9:53 AM

Great answer! I was looking for this for a long time!

Luis Filipe Castanheira
on 4/8/14, 9:19 AM

@Soukaina Use version="7.0" on view declaration

Parth Gajjar
on 5/2/14, 8:57 AM
0
Sascha Pfeiffer
On 11/3/14, 1:16 AM

Couldnt post a multiline comment so here is your solution @Soukaina SBITTI:


                <form string="Test" version="7.0">
                        <field name="a"/>
                        <field name="b"/>
                        <field name="c" class="oe_edit_only"/>
                </form>

0
Soukaina SBITTI
On 3/10/14, 11:28 AM

Please, could someone explain to me how to add a class to a field.i tried it but it shows me an XML architecture error.do i have to do something before using it?Thank you

Like mentioned in the above comments, simply use version="7.0" before so something like:

Sascha Pfeiffer
on 11/3/14, 1:14 AM

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: 4/17/13, 4:06 AM
Seen: 6831 times
Last updated: 4/7/16, 11:32 AM