Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6144 Lượt xem

Hi!

I am trying to add my custom css to my pdf report (inherited account.report_invoice_document). To link the css file, I add this code in xml file:

<template id="assets_backend" name="invoice assets" 
 inherit_id="account.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet"
         href="/mymodule/static/src/css/account_invoice_report.css"/>
</xpath>
</template>
 When I print my invoice, I cannot see the right layout, according to added classes.

I have tried the same in v9 and everything is working, but in v8 it doesn't.

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Custom css directly add in custom report.

<?xml version="1.0" encoding="utf-8"?>

<odoo> 

        <template id="report_custom">

            <t t-foreach="docs" t-as="o">

                <div class="page" >

                    <style>

                            .table_border{border:1px solid black; padding: 5px; width:100%; border-collapse: collapse;}

                            .table_border tr td{border:1px solid black; padding: 2px;}

                    </style>

               </div>

             </t>

         </template>

</odoo>




Ảnh đại diện
Huỷ bỏ

Thanks @Akash Balar, It helps me a lot

Câu trả lời hay nhất

Hi,

if its not working like this you can directy give style to your attributes

It should effect.

virzoteck@gmail.com

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 4 25
5180
5
thg 1 20
7903
1
thg 7 15
4601
0
thg 4 24
1241
7
thg 5 23
32139