تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2879 أدوات العرض

I have created two files 'fileone.css' and 'filetwo.scss'. they have styles for my template to generate a PDF report in sales app.

I want to add these two style files to the "assets" in the "__manifest__".

the pb is I don't know where to put them. there is 2 assets: 

'web.report_assets_common'  and 'web.report_assets_pdf'.

which one I should pick ?


'assets': {
'web.report_assets_common': [
'/my_addons/static/src/scss/filetwo.scss',
'/my_addons/static/src/css/fileone.css',
],
'web.report_assets_pdf': [
'/my_addons/static/src/scss/filetwo.scss',
'/my_addons/static/src/css/fileone.css',
],
},


Anyone could help?

Thanks.

الصورة الرمزية
إهمال
أفضل إجابة

Hi Liam Robs,

If you want to use custom fonts you will need to add your custom font and the related less/CSS to the web.reports_assets_common assets bundle.

Example:

'assets': {
'web.report_assets_common': [
'your_module/static/src/less/fonts.less'
],

and let's say this is your fonts.less file

  1. web.reports_assets_common
  • This speaks about the common resources that Odoo uses for its web-based reports. on Odoo, reports are frequently created and displayed on a web interface. These reports may contain a variety of assets, including JavaScript files, CSS stylesheets, and other resources needed for proper report rendering. 

  2. web.report_assets_pdf

  •  This phrase probably has something to do with creating PDF reports in Odoo. With Odoo, you can create PDF versions of many system reports and documents.
  • This can contain the materials needed to design the layout, style the PDF output, and guarantee that the content is accurately converted to PDF format.

The main difference is report_assets_common affected on both web view and pdf view while report_assets_pdf does not affected on web view.

Thank you.


الصورة الرمزية
إهمال
الكاتب

Thank you so much for the information.

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
فبراير 24
8789
1
يونيو 19
4197
0
نوفمبر 23
2060
0
نوفمبر 23
1569
1
يوليو 25
4441