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

Hello,

I have a module named quality_and_inspection. It has a large amount of fields and tree views so I decided to increase it width to 1100px. 

I am adding my custom styles to following CSS class:

.o_form_view .o_form_sheet_bg .o_form_sheet {

    min-width: 1100px;

    max-width: 1100px;

}

and calling the custom CSS file by following code:

<template id="assets_backend" name="custom assets" inherit_id="web.assets_backend"> 

    <xpath expr="." position="inside">

    <link rel="stylesheet" href="/Invoice_Customization_Naseem/static/src/css/styles.css"/>

    </xpath> 

</template>


The problem is that its applying the above mentioned styles to whole ERP including forms  and tree views of all the modules in the system. Please suggest some solution which results as the change of styles in my quality_and_inspection module's form view only.

Thanks!

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

Hi

you can define classes in xml and give the required css for that class.

อวตาร
ละทิ้ง
ผู้เขียน

Thanks... It works

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

Hi, i have the same problem, how did you solve it?


อวตาร
ละทิ้ง
ผู้เขียน

Define the css tag and its contents within form view after form tag. Plus the classes you use should not be odoo specific or global in nature.

@Mian Kmaran what do you mean by class here ? any example?

What about a tree view !?

ผู้เขียน

Tree view doesn't allow custom css.. So just got an idea, it may work or not, try assigning a class to tree tag and see if it comes in inspector. The target it in global css and make changes.
Just an idea, I hvnt done it

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 18
106
1
พ.ค. 17
8436
0
ก.พ. 25
1082
2
ธ.ค. 24
1414
0
ก.ค. 24
1167