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

how can i use css and js in template called by controller odoo 15

i try using

inherit_id

website.assets_common but it seem doesnt work and i got error External Id not found .

I already add depends web

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

From v15 onwards, adding the assets have been changed and has been moved into the manifest.

Before v15, we were used to inheriting the asset in the XML and adding our custom assets.

But from v15, the asset definition has been moved into the __manfiest__.py of the module as shown below:

'assets': {
    'web.assets_backend': [
        'web/static/src/xml/**/*',
    ],
    'web.assets_common': [
        'web/static/lib/bootstrap/**/*',
        'web/static/src/js/boot.js',
        'web/static/src/js/webclient.js',
    ],
    'web.qunit_suite_tests': [
        'web/static/src/js/webclient_tests.js',
    ],
},

Check assets documentation for more information.


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

hi

for css & js use inherit_id="web.assets_backend"

in website 'user interface' you can use inherit_id='web.assets_frontend'

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 20
7453
0
thg 3 17
3853
3
thg 12 24
22059
0
thg 8 20
4632
1
thg 12 19
5979