This question has been flagged

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.

Avatar
Discard

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.

Author

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.

Author

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.