Skip to content

[ADD] web_onchange_action - #579

Merged
StefanRijnhart merged 2 commits into
OCA:8.0from
hbrunn:8.0-web_onchange_action
Jan 16, 2018
Merged

StefanRijnhart merged 2 commits into
OCA:8.0from
hbrunn:8.0-web_onchange_action

Conversation

@hbrunn

@hbrunn hbrunn commented Mar 13, 2017

Copy link
Copy Markdown
Member

Onchange actions

This module allows you to return an action (ir.actions.*) from an onchange handler.

This way, you can have much more elaborate message boxes or simply show a whole wizard or do whatever else is possible with actions on the client side.

Usage

Depend on this module and in your onchange handler, add a key action to the warning dictionary of the result which contains the definition of an action to execute:

.. code:: python

{
    'value': ....,
    'domain': ....,
    'warning': {
        'title': 'This will be shown if this module is not available',
        'message': 'Fallback message, see above',
        # this module picks up this key and shows it *instead* of the
        # warning above
        'action': {
            'type': 'ir.actions.act_window',
            'res_model': 'my.wizard',
            ...
        },
}

The module web_ir_actions_act_window_message can be quite helpful here.

@hbrunn hbrunn added this to the 8.0 milestone Mar 13, 2017
Comment thread web_onchange_action/README.rst Outdated

This module allows you to return an action (``ir.actions.*``) from an onchange handler.

Whit way, you can have much more elaborate message boxes or simply show a whole wizard or do whatever else is possible with actions on the client side.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "Whit whay"

@StefanRijnhart StefanRijnhart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, cool and elegant.

@StefanRijnhart

Copy link
Copy Markdown
Member

@hbrunn Don't forget the typo that @LeartS noticed.

@StefanRijnhart

Copy link
Copy Markdown
Member

OMG used inline Github editing for the first time to correct the typo.

@hbrunn

hbrunn commented Jan 16, 2018

Copy link
Copy Markdown
Member Author

can we merge?

@StefanRijnhart
StefanRijnhart merged commit cc74a41 into OCA:8.0 Jan 16, 2018
@StefanRijnhart

Copy link
Copy Markdown
Member

Merge slightly overdue!

@paulius-sladkevicius

Copy link
Copy Markdown

Hi @hbrunn, @StefanRijnhart do you know if something similar exists on the v13/14 or best to try to port this one?

@StefanRijnhart

StefanRijnhart commented Apr 12, 2021

Copy link
Copy Markdown
Member

Nope, I think Odoo missed this one when it looked for good OCA modules to reimplement in the core.

@paulius-sladkevicius

Copy link
Copy Markdown

Nope, I think Odoo missed this one when it looked for good OCA modules to reimplement in the core.

@StefanRijnhart thanks, in this case we'll try to port it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants