2
.. i18n: Information Repository
3
.. i18n: ======================
9
.. i18n: The information repository is a semantics tree in which the datas that are not the ressources are stocked. We find in this structure:
12
The information repository is a semantics tree in which the datas that are not the ressources are stocked. We find in this structure:
14
.. i18n: 1. the values by default
15
.. i18n: 2. the conditional values;
16
.. i18n: * the state depends on the zip code,
17
.. i18n: * the payment method depends of the partner, ...
18
.. i18n: 3. the reactions to the events client;
19
.. i18n: * click on the invoice menu,
20
.. i18n: * print an invoice,
21
.. i18n: * action on a partner, ...
24
1. the values by default
25
2. the conditional values;
26
* the state depends on the zip code,
27
* the payment method depends of the partner, ...
28
3. the reactions to the events client;
29
* click on the invoice menu,
31
* action on a partner, ...
33
.. i18n: The IR has 3 methods;
38
.. i18n: * add a value in the tree
39
.. i18n: * delete a value in the tree
40
.. i18n: * obtain all the values of a selected sheet
43
* add a value in the tree
44
* delete a value in the tree
45
* obtain all the values of a selected sheet
47
.. i18n: Setting Value
48
.. i18n: -------------
54
.. i18n: The ir_set tag allows you to insert new values in the "Information
55
.. i18n: Repository". This tag must contain several *field* tags with *name* and *eval*
59
The ir_set tag allows you to insert new values in the "Information
60
Repository". This tag must contain several *field* tags with *name* and *eval*
63
.. i18n: The attributes are those defined by the access methods to the information
64
.. i18n: repository. We must provide it with several attributes: *keys*, *args*, *name*,
65
.. i18n: *value*, *isobject*, *replace*, *meta* and some optional fields.
68
The attributes are those defined by the access methods to the information
69
repository. We must provide it with several attributes: *keys*, *args*, *name*,
70
*value*, *isobject*, *replace*, *meta* and some optional fields.
77
.. i18n: .. code-block:: xml
80
.. i18n: <field name="keys" eval="[('action','client_print_multi'),('res_model','account.invoice')]"/>
81
.. i18n: <field name="args" eval="[]"/>
82
.. i18n: <field name="name">Print Invoices</field>
83
.. i18n: <field name="value" eval="'ir.actions.report.xml,'+str(l0)"/>
84
.. i18n: <field name="isobject" eval="True"/>
85
.. i18n: <field name="replace" eval="False"/>
92
<field name="keys" eval="[('action','client_print_multi'),('res_model','account.invoice')]"/>
93
<field name="args" eval="[]"/>
94
<field name="name">Print Invoices</field>
95
<field name="value" eval="'ir.actions.report.xml,'+str(l0)"/>
96
<field name="isobject" eval="True"/>
97
<field name="replace" eval="False"/>
107
.. i18n: .. code-block:: python
109
.. i18n: def ir_set(cr, uid, key, key2, name, models, value, replace=True, isobject=False, meta=None)
112
.. code-block:: python
114
def ir_set(cr, uid, key, key2, name, models, value, replace=True, isobject=False, meta=None)
116
.. i18n: .. code-block:: python
118
.. i18n: def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False)
121
.. code-block:: python
123
def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False)
125
.. i18n: .. code-block:: python
127
.. i18n: def ir_del(cr, uid, id):
130
.. code-block:: python
132
def ir_del(cr, uid, id):
134
.. i18n: :Description of the fields:
137
:Description of the fields:
144
.. i18n: 6. isobject:
145
.. i18n: 7. replace: whether or not the action described should override an existing action or be appended to the list of actions.
155
7. replace: whether or not the action described should override an existing action or be appended to the list of actions.
158
.. i18n: :Using ir_set and ir_get:
161
:Using ir_set and ir_get:
163
.. i18n: .. code-block:: python
167
.. i18n: res = ir.ir_set(cr, uid, key, key2, name, models, value, replace, isobject, meta)
173
.. i18n: if not report.menu_id:
175
.. i18n: ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
179
.. i18n: ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
185
.. i18n: res = ir.ir_get(cr, uid, [('default', self._name), ('field', False)], [('user_id',str(uid))])
189
.. i18n: account_payable = ir.ir_get(cr, uid, [('meta','res.partner'), ('name','account.payable')], opt)[0][2]
194
.. code-block:: python
198
res = ir.ir_set(cr, uid, key, key2, name, models, value, replace, isobject, meta)
204
if not report.menu_id:
206
ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
210
ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
216
res = ir.ir_get(cr, uid, [('default', self._name), ('field', False)], [('user_id',str(uid))])
220
account_payable = ir.ir_get(cr, uid, [('meta','res.partner'), ('name','account.payable')], opt)[0][2]