Skip to Content
Menu
This question has been flagged
3 Replies
1226 Views

Testing odoo.addons.base.models.ir_ui_view: Using active_id, active_ids and active_model in expressions is deprecated, found active_id 

_logger.warning("Using active_id, active_ids and active_model in expressions is deprecated, found %s", name)

how stop this 

warning


Avatar
Discard
Best Answer

Hi Zakariya Mahmoud,

Try to use this,

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning, module="odoo.addons.base.models.ir_ui_view")
_logger.warning("Using active_id, active_ids, and active_model in expressions is deprecated, found %s", name)

Try this

Thanks
Avatar
Discard
Author

Thanks @Nikhil Nakrani

Best Answer

Does somebody have an actual solution for this ? Because hiding the warning isn't really a fix...

Does it need to take a specific action to still work?

Avatar
Discard

I use id instead o active_id and no warning and seems works
ex.: [('id', '!=', id)]

Best Answer

I agree that suppressing the warning is not ideal, it does not serve the future self.


Look at the file accessed before this warning, something like:

`odoo.modules.loading: loading *.xml`


Open that file and look for the value found, in the case of the original post `active_id`


Now, I am not sure, but I believe the correction would be to replace it with `id` instead. Please test this before accepting it as the answer.

Avatar
Discard

That's it, thank you Matthew :)

Great! Glad to hear it. It is worth noting that active_id context is valid in smart buttons it seems.

Related Posts Replies Views Activity
2
Sep 24
278
2
Aug 24
173
3
Aug 24
263
2
Aug 24
239
0
Aug 24
1488