如何限制自定义样式仅适用于特定模块的表单视图

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

我有一个名为 quality_and_inspection 的模块。它有大量的字段和树视图,所以我决定将它的宽度增加到 1100 像素。

我正在将我的自定义样式添加到以下 CSS class:

.o_form_view .o_form_sheet_bg .o_form_sheet {
    min-width: 1100px;
    max-width: 1100px;
}

并通过以下代码调用自定义 CSS 文件:

<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>

问题是它将上述样式应用于整个 ERP,包括系统中所有模块的表单和树视图。请提出一些解决方案,结果仅在我的 quality_and_inspection 模块的表单视图中更改样式。

谢谢!

只是一个想法,将您的所有字段都放在 div 中,然后在 div 中添加一个特殊的 class 目标字段。我使用了这种技术并且对我有用。