Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
12 ตอบกลับ
24393 มุมมอง

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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

There is no inverse of oe_edit_only in Odoo 7.0

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!

Thank you!!

This is really an important feature!

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

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

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

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

@Soukaina Use version="7.0" on view declaration

คำตอบที่ดีที่สุด

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:

คำตอบที่ดีที่สุด

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>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Web Module not loading the css แก้ไขแล้ว
2
มี.ค. 15
21994
1
เม.ย. 23
5004
1
ก.ค. 24
1984
1
ก.ค. 24
2000
4
ม.ค. 24
23182