How to debug api.onchange methods? _logger.xyz() doesn't get printed on the server console. I don't see them at the browser's console also.
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
- Dự án
- MRP
Câu hỏi này đã bị gắn cờ
4683
Lượt xem
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 | |
|---|---|---|---|---|
|
|
2
thg 1 25
|
7666 | ||
|
computed fields
Đã xử lý
|
|
1
thg 4 24
|
3644 | |
|
|
1
thg 4 24
|
3726 | ||
|
|
1
thg 12 23
|
6531 | ||
|
Menu item for users and group only
Đã xử lý
|
|
2
thg 11 22
|
5141 |
The the below link show you how to use logging in Odoo
https://www.odoo.yenthevg.com/logging-in-odoo/
If you code is correct and you can't see the logger text then your method is not called.
If you want to get more help from the forum, please submit your code.
Hi Waleed,
Thanks for your response. The link you shared explains logging in Odoo in general context. But this case is specific to code inside @api.onchange. I believe api.onchange methods are generally not executed on the server-side and I assume those should be converted to equivalent Javascript code and executed at the client-side. If this is the case, how to debug api.onchange() methods in general?
The logging is working even in api.onchange methods but your method is not called at all. I already tested it and it's working. Please check why your method is not called at all.
I'm talking here about POS module. Does api.onchange methods get called for Odoo12 POS UI? It looks like different from the default odoo {form,tree,kanban} views. It has it's own UI in static/ directory. api.constrains() are getting called though.