تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3940 أدوات العرض

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.

الصورة الرمزية
إهمال

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يناير 25
6304
computed fields تم الحل
1
أبريل 24
2327
1
أبريل 24
2480
1
ديسمبر 23
4228
2
نوفمبر 22
3585