跳至内容
菜单
此问题已终结
2 回复
7326 查看

Hi, I try to load css file inside my template but with no results.


<template id="report_quatations_document" inherit_id="sale.report_saleorder_document">

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

         <link rel="stylesheet" href="/my_module/static/src/css/tablas.css"/>

     </xpath>

                <xpath expr="//div[@class='page']//h2" position="replace">

                    <t t-if="doc.team_id.name == 'Laboratorio'">


                        <table> 

                            <tbody>

                                <tr style="width: 33%;">

                                    <td>FORMA DE ENVÍO</td>

                                    <td>Fax</td>

                                    <td>Email</td>

                                </tr>

                                <tr>

                                    <td></td>

                                    <td>Correo Postal Ordinario</td>

                                    <td class="last-element">Mensajería</td>

                                </tr>

                                <tr>

                                    <td></td>

                                    <td>Correo Postal Certificado</td>

                                    <td class="last-element">Entrega Personal</td>

                                </tr>

                            </tbody>

                        </table>

                </xpath>

</template>


Is that (in bold) correct way to load the css file?

形象
丢弃
最佳答案

Hi Jakub:

Remove the bold part from this and put it in a custom template that extends web.report_assets_common

形象
丢弃
最佳答案

You may want to read this little tutorial from Yenthe about adding static resources to Odoo in general:

https://www.odoo.yenthevg.com/adding-static-resources-css-and-javascript-to-odoo/

形象
丢弃
相关帖文 回复 查看 活动
2
9月 24
1259
0
10月 20
2391
0
6月 15
3927
4
4月 24
20228
0
12月 20
6117