css - 将 CSS 代码添加到我的模块后出错 (ODOO 12)
问题描述
我有 3 个图像字段的问题,我希望它们在同一行,所以我在我的模块目录中添加了一些 css 代码,如下所示:odoo/addons/GestionIMMO/static/src/scss/GestionIMMO.scss
这是我的 GestionIMMO.scss 代码:
.mmligne{text-align:right;}
这是我的 gesimmo_views.xml 代码
<odoo>
<template id="assets_backend" name="GestionIMMO assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/GestionIMMO/static/src/css/GestionIMMO.css"/>
</xpath>
</template>
<record model="ir.ui.view" id="view_form_gesimmo">
<field name="name">Product</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='default_code']" position="after">
<group>
<field name="prop" style="width:300%%"/>
<field name="ref" style="width:300%%"/>
<field name="surface" style="width:300%%"/>
<field name="immo_cat" style="width:300%%"/>
<field name="immo_titre" style="width:300%%"/>
<field name="immo_date" style="width:300%%"/>
<br/>
<br/>
<div class="mmligne">
<field name="img_one" widget="image" style="width:300%%"/>
<field name="img_two" widget="image" style="width:300%%"/>
<field name="img_three" widget="image" style="width:300%%"/>
</div>
</group>
</xpath>
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='barcode']" position="attributes" nolabel="true">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='categ_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='type']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='default_code']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//label[@for='standard_price']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='taxes_id']" position="after">
<group>
<field name="nbre_ch" style="width:200%%"/>
<field name="pr" style="width:200%%"/>
<br />
<br />
<br />
<br />
<br />
<field name="rue" placeholder="Rue" style="width:200%%"/>
<field name="gouv" placeholder="Gouvernorat" style="width:200%%"/>
<field name="ville" placeholder="Ville" style="width:200%%"/>
<field name="codepostal" placeholder="Code postal" style="width:200%%"/>
<field name="pays" placeholder="Pays" style="width:200%%"/>
</group>
</xpath>
<xpath expr="//field[@name='taxes_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='list_price']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<label for="name" position="replace">
<label for="name" string="Nom du bien immobilier"/>
</label>
<label for="sale_ok" position="replace">
<label for="sale_ok" string="A Vendre"/>
</label>
<label for="purchase_ok" position="replace">
<label for="purchase_ok" string="A Louer"/>
</label>
<xpath expr="//field[@name='rue']" position="before">
<button name="open_map" string="Localisation sur Google Maps" type="object" class="oe_highlight" style="width:100%%"/>
</xpath>
<xpath expr="//page[@name='variants']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='sales']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='purchase']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='inventory']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<!--<xpath expr="//button[@name='uom_name']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>-->
<!-- <xpath expr="//page[@name='shop']" position="attributes">
<attribute name="invisible">1</attribute>-->
</field>
</record>
</odoo>
我有这个错误:
The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.
Could not get content for /GestionIMMO/static/src/css/GestionIMMO.css defined in bundle 'web.assets_backend'.
ps : 我继承了 product_template 视图
请帮忙
解决方案
您已定义scss => GestionIMMO/static/src/scss/GestionIMMO.scss 在资产上添加错误的路径 ref /GestionIMMO/static/src/css/GestionIMMO.css。
正确的
<link rel="stylesheet" href="/GestionIMMO/static/src/scss/GestionIMMO.scss"/>
谢谢
推荐阅读
- ios - 我可以像这样将 iOS NSString 保存到 Rails DateTime 吗?
- php - 选择所有行并输出到数组 phpmyadmin
- sql - 在 SQL Server 中使用 Join 获取此输出时出现问题
- firebase - Google Cloud 和 Firebase 浏览器与服务器密钥
- json - 如何快速处理这个 JSON 请求 4
- java - Kafka - 有什么比 poll() 更好的选择来听 Java 中的主题?
- exception - 从一条骆驼路线继续异常并在另一条骆驼路线中处理
- docker - 使用 Kubernetes 为外部应用程序发现服务 IP 和端口
- php - 建立数据库连接时出错。在 Wamp 本地主机上安装 wordpress 时
- c++ - glog (c++) 可以在其堆栈跟踪中打印行号吗?