Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
5179 มุมมอง

Hi

I want to apply css in custom report,i need help for that

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello,

You can do that by adding css files to the path then assign css classes to the html in your report

/static/src/css

Then You call the css file.

There are two main assets,frontend and backend assets.

Frontend assets are used for website while backend assets are used for the system backend, and since you want to use it in the report which i will assume will be in the backend you will inherit the assets_backend.

Calling the asset might differ from one version to another

If you are using odoo15 or later you call the css in the manifest by adding assets field

'assets': {
'web.assets_backend'
: [
'your_module_name/static/src/css/first_css_file.css',
'your_module_name/static/src/css/second_css_file.css',
],

If you are using odoo 14 or older version

You call the css in an xml view


			
​​

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

if you are using Odoo version 16, then adding custom_css_file.css wont work, instead rename it with .scss file extension and load it, it will work

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Thank you very much Emad, it helps me =)

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you for responding i will try it.

อวตาร
ละทิ้ง