diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-09-25 15:52:55 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-09-25 17:17:25 +0200 |
| commit | 17ef915ff264589710374dd4b966cb0cbfd04730 (patch) | |
| tree | 92ab3738ecf0f03ca2daed43fba59f54b7069355 /doc/reference/javascript_cheatsheet.rst | |
| parent | 17573f40943e91d7b9ddce3125f69373b359381b (diff) | |
[DOC] doc: add information on session and client action
Diffstat (limited to 'doc/reference/javascript_cheatsheet.rst')
| -rw-r--r-- | doc/reference/javascript_cheatsheet.rst | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/doc/reference/javascript_cheatsheet.rst b/doc/reference/javascript_cheatsheet.rst index ea22e8f4715..c4d403b6b8e 100644 --- a/doc/reference/javascript_cheatsheet.rst +++ b/doc/reference/javascript_cheatsheet.rst @@ -130,51 +130,6 @@ This is usually done with code looking like this: }); -Adding a client action -====================== - -A client action is a widget which will control the part of the screen below the -menu bar. It can have a control panel, if necessary. Defining a client action -can be done in two steps: implementing a new widget, and registering the widget -in the action registry. - -- Implementing a new client action: - This is done by creating a widget: - - .. code-block:: javascript - - var ControlPanelMixin = require('web.ControlPanelMixin'); - var AbstractAction = require('web.AbstractAction'); - - var ClientAction = AbstractAction.extend(ControlPanelMixin, { - ... - }); - - Do not add the controlpanel mixin if you do not need it. Note that some - code is needed to interact with the control panel (via the - ``update_control_panel`` method given by the mixin). - -- Registering the client action: - As usual, we need to make the web client aware of the mapping between - client actions and the actual class: - - .. code-block:: javascript - - var core = require('web.core'); - - core.action_registry.add('my-custom-action', ClientAction); - - - Then, to use the client action in the web client, we need to create a client - action record (a record of the model ``ir.actions.client``) with the proper - ``tag`` attribute: - - .. code-block:: xml - - <record id="my_client_action" model="ir.actions.client"> - <field name="name">Some Name</field> - <field name="tag">my-custom-action</field> - </record> Creating a new view (from scratch) ================================== |
