diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-04-17 19:20:34 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-04-17 19:20:34 +0200 |
| commit | c472efa688fbf4e0de1a3bec0ea620ed0f43c988 (patch) | |
| tree | 73bc6be07d6887948883070e08d62172134dbafb /doc/03_module_dev_04.rst | |
| parent | c57660ae79f988385a8df57a85d040dcda8ee6ef (diff) | |
[DOC] [REF] Refactoring of the module chapter, still WIP ...
bzr revid: tde@openerp.com-20120417172034-h5pzpiair5sk94wz
Diffstat (limited to 'doc/03_module_dev_04.rst')
| -rw-r--r-- | doc/03_module_dev_04.rst | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/03_module_dev_04.rst b/doc/03_module_dev_04.rst index 9bd17c8e7dd..f8ad0e2f554 100644 --- a/doc/03_module_dev_04.rst +++ b/doc/03_module_dev_04.rst @@ -316,3 +316,58 @@ A report is declared using a **report tag** inside a "data" block. The different * **rml** : the .RML report model. Important Note : Path is relative to addons/ directory. * **menu** : whether the report will be able to be called directly via the client or not. Setting menu to False is useful in case of reports called by wizards. * **auto** : determines if the .RML file must be parsed using the default parser or not. Using a custom parser allows you to define additional functions to your report. + + + + + +Action creation +--------------- + +Linking events to action +++++++++++++++++++++++++ + +The available type of events are: + + * **client_print_multi** (print from a list or form) + * **client_action_multi** (action from a list or form) + * **tree_but_open** (double click on the item of a tree, like the menu) + * **tree_but_action** (action on the items of a tree) + +To map an events to an action: + +.. code-block:: xml + + <record model="ir.values" id="ir_open_journal_period"> + <field name="key2">tree_but_open</field> + <field name="model">account.journal.period</field> + <field name="name">Open Journal</field> + <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/> + <field name="object" eval="True"/> + </record> + +If you double click on a journal/period (object: account.journal.period), this will open the selected wizard. (id="action_move_journal_line_form_select"). + +You can use a res_id field to allow this action only if the user click on a specific object. + +.. code-block:: xml + + <record model="ir.values" id="ir_open_journal_period"> + <field name="key2">tree_but_open</field> + <field name="model">account.journal.period</field> + <field name="name">Open Journal</field> + <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/> + <field name="res_id" eval="3"/> + <field name="object" eval="True"/> + </record> + +The action will be triggered if the user clicks on the account.journal.period n°3. + +When you declare wizard, report or menus, the ir.values creation is automatically made with these tags: + + * <wizard... /> + * <menuitem... /> + * <report... /> + +So you usually do not need to add the mapping by yourself. + |
