Sabir Mustafa
Sabir Mustafa

Reputation: 188

How to restrict custom styles to apply only on form view of a particular module

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!

Upvotes: 1

Views: 313

Answers (1)

Charif DZ
Charif DZ

Reputation: 14751

Just an idea make all of your field inside a div with a special class then target field inside that div. I used this technique and it worked for me.

Upvotes: 1

Related Questions