This is my custom page in dpsir module
xml version="1.0" encoding="utf-8"?><odoo><templateid="custom_page"name="custom page"> <tt-call="website.layout"> <scripttype="text/javascript"src="/dpsir/static/src/js/custom.js">script> t>template>odoo>
and this is custom js file
odoo.define('dpsir.custom', function (require) { // Your code here});
I'm getting uncaught reference error odoo is not defined
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi
add your javascript file under module_name -> static -> src-> js folder.
you can code as like following
odoo.define('module_name.models', function (require) {
});
and you can load the js file in the manifest
'assets': {
'web.assets_frontend': [
'module_name/static/src/js/file_name.js’]
}
check this references for js file
https://www.odoo.com/documentation/16.0/developer/reference/frontend/javascript_modules.html
Hope this Helps
Regards
Can you also share that how you can add custom js file in your template
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 7 25
|
261 | ||
|
0
thg 6 25
|
488 | ||
|
1
thg 6 25
|
711 | ||
|
1
thg 6 25
|
736 | ||
|
1
thg 5 25
|
1287 |
what if I want to use the javascript file for frontend website, like handling button click, adding or removing class of an html element useing jquery etc.?