~openerp-dev/openobject-doc/trunk

« back to all changes in this revision

Viewing changes to i18n/ro/source/developer/2_4_module_development/4_4_createing_action.rst

  • Committer: Antony Lesuisse
  • Date: 2010-03-05 16:46:40 UTC
  • Revision ID: al@openerp.com-20100305164640-9b7anc1t5ujha8lw
Merge doc into feature, before deletion of both features and doc. (odo)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. i18n: Creating Action
 
3
.. i18n: ===============
 
4
.. i18n:   
 
5
.. i18n: Linking events to action
 
6
.. i18n: -------------------------
 
7
..
 
8
 
 
9
Creating Action
 
10
===============
 
11
  
 
12
Linking events to action
 
13
-------------------------
 
14
 
 
15
.. i18n: The available type of events are:
 
16
..
 
17
 
 
18
The available type of events are:
 
19
 
 
20
.. i18n:     * **client_print_multi** (print from a list or form)
 
21
.. i18n:     * **client_action_multi** (action from a list or form)
 
22
.. i18n:     * **tree_but_open** (double click on the item of a tree, like the menu)
 
23
.. i18n:     * **tree_but_action** (action on the items of a tree) 
 
24
..
 
25
 
 
26
    * **client_print_multi** (print from a list or form)
 
27
    * **client_action_multi** (action from a list or form)
 
28
    * **tree_but_open** (double click on the item of a tree, like the menu)
 
29
    * **tree_but_action** (action on the items of a tree) 
 
30
 
 
31
.. i18n: To map an events to an action:
 
32
..
 
33
 
 
34
To map an events to an action:
 
35
 
 
36
.. i18n: .. code-block:: xml
 
37
.. i18n: 
 
38
.. i18n:     <record model="ir.values" id="ir_open_journal_period">
 
39
.. i18n:         <field name="key2">tree_but_open</field>
 
40
.. i18n:         <field name="model">account.journal.period</field>
 
41
.. i18n:         <field name="name">Open Journal</field>
 
42
.. i18n:         <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/>
 
43
.. i18n:         <field name="object" eval="True"/>
 
44
.. i18n:     </record>
 
45
..
 
46
 
 
47
.. code-block:: xml
 
48
 
 
49
    <record model="ir.values" id="ir_open_journal_period">
 
50
        <field name="key2">tree_but_open</field>
 
51
        <field name="model">account.journal.period</field>
 
52
        <field name="name">Open Journal</field>
 
53
        <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/>
 
54
        <field name="object" eval="True"/>
 
55
    </record>
 
56
 
 
57
.. i18n: 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").
 
58
..
 
59
 
 
60
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").
 
61
 
 
62
.. i18n: You can use a res_id field to allow this action only if the user click on a specific object.
 
63
..
 
64
 
 
65
You can use a res_id field to allow this action only if the user click on a specific object.
 
66
 
 
67
.. i18n: .. code-block:: xml
 
68
.. i18n: 
 
69
.. i18n:     <record model="ir.values" id="ir_open_journal_period">
 
70
.. i18n:         <field name="key2">tree_but_open</field>
 
71
.. i18n:         <field name="model">account.journal.period</field>
 
72
.. i18n:         <field name="name">Open Journal</field>
 
73
.. i18n:         <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/>
 
74
.. i18n:         <field name="res_id" eval="3"/>
 
75
.. i18n:         <field name="object" eval="True"/>
 
76
.. i18n:     </record>
 
77
..
 
78
 
 
79
.. code-block:: xml
 
80
 
 
81
    <record model="ir.values" id="ir_open_journal_period">
 
82
        <field name="key2">tree_but_open</field>
 
83
        <field name="model">account.journal.period</field>
 
84
        <field name="name">Open Journal</field>
 
85
        <field name="value" eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select"/>
 
86
        <field name="res_id" eval="3"/>
 
87
        <field name="object" eval="True"/>
 
88
    </record>
 
89
 
 
90
.. i18n: The action will be triggered if the user clicks on the account.journal.period n°3.
 
91
..
 
92
 
 
93
The action will be triggered if the user clicks on the account.journal.period n°3.
 
94
 
 
95
.. i18n: When you declare wizard, report or menus, the ir.values creation is automatically made with these tags:
 
96
..
 
97
 
 
98
When you declare wizard, report or menus, the ir.values creation is automatically made with these tags:
 
99
 
 
100
.. i18n:   * <wizard... />
 
101
.. i18n:   * <menuitem... />
 
102
.. i18n:   * <report... /> 
 
103
..
 
104
 
 
105
  * <wizard... />
 
106
  * <menuitem... />
 
107
  * <report... /> 
 
108
 
 
109
.. i18n: So you usually do not need to add the mapping by yourself. 
 
110
..
 
111
 
 
112
So you usually do not need to add the mapping by yourself.