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
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
3375
Views
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.