[8.0][FIX] ActWindow from Python Method after Popup - #846
Conversation
Allow python methods called from an ir.action.act_window.message action to return window actions without specifying the ``views`` key, as they would be if called from a button defined in xml. ``view_mode`` key is used for creating the views array as it is required anyway
hbrunn
left a comment
There was a problem hiding this comment.
if you really want to fix this here instead of the offending button handler, your code should do exactly what the server does: https://github.com/OCA/OCB/blob/8.0/addons/web/controllers/main.py#L373
I personally would be in favor of fixing the method you call.
|
I used the confirmation popup from a wizard button that was formerly calling my python method, and the action was working ok, but after I call the same method from the popup button itself it does not. |
|
thanks! I think you have a peculiar way of formatting your code, but given we have no formal conventions about js style, I won't discuss js style |
|
Haha Im a Python programmer, and not even that good to talk about conventions either, but being able to help is always nice 👌 |
Pull Request OCA#846 was aimed to allow devs to return window actions from python code without specifying the views, but introduced a bug when the action was not of type window. This commit pretends to fix that.
Pull Request OCA#846 was aimed to allow devs to return window actions from python code without specifying the views, but introduced a bug when the action was not of type window. This commit pretends to fix that.
Allow python methods called from an ir.action.act_window.message
action to return window actions without specifying the
viewskey, as they would be if called from a button defined in xml.
view_modekey is used for creating the views array as it is required anyway.Problem:
After calling a popup message defined like
the action returned from the method
apply_methodwhich was something likeended up in a JS error.
