2
.. i18n: Information Repository
3
.. i18n: ======================
8
.. i18n: The information repository is a semantics tree in which the datas that are not the ressources are stocked. We find in this structure:
10
The information repository is a semantics tree in which the datas that are not the ressources are stocked. We find in this structure:
12
.. i18n: 1. the values by default
13
.. i18n: 2. the conditional values;
14
.. i18n: * the state depends on the zip code,
15
.. i18n: * the payment method depends of the partner, ...
16
.. i18n: 3. the reactions to the events client;
17
.. i18n: * click on the invoice menu,
18
.. i18n: * print an invoice,
19
.. i18n: * action on a partner, ...
21
1. the values by default
22
2. the conditional values;
23
* the state depends on the zip code,
24
* the payment method depends of the partner, ...
25
3. the reactions to the events client;
26
* click on the invoice menu,
28
* action on a partner, ...
30
.. i18n: The IR has 3 methods;
34
.. i18n: * add a value in the tree
35
.. i18n: * delete a value in the tree
36
.. i18n: * obtain all the values of a selected sheet
38
* add a value in the tree
39
* delete a value in the tree
40
* obtain all the values of a selected sheet
42
.. i18n: Setting Value
43
.. i18n: -------------
48
.. i18n: The ir_set tag allows you to insert new values in the "Information
49
.. i18n: Repository". This tag must contain several *field* tags with *name* and *eval*
52
The ir_set tag allows you to insert new values in the "Information
53
Repository". This tag must contain several *field* tags with *name* and *eval*
56
.. i18n: The attributes are those defined by the access methods to the information
57
.. i18n: repository. We must provide it with several attributes: *keys*, *args*, *name*,
58
.. i18n: *value*, *isobject*, *replace*, *meta* and some optional fields.
60
The attributes are those defined by the access methods to the information
61
repository. We must provide it with several attributes: *keys*, *args*, *name*,
62
*value*, *isobject*, *replace*, *meta* and some optional fields.
68
.. i18n: .. code-block:: xml
71
.. i18n: <field name="keys" eval="[('action','client_print_multi'),('res_model','account.invoice')]"/>
72
.. i18n: <field name="args" eval="[]"/>
73
.. i18n: <field name="name">Print Invoices</field>
74
.. i18n: <field name="value" eval="'ir.actions.report.xml,'+str(l0)"/>
75
.. i18n: <field name="isobject" eval="True"/>
76
.. i18n: <field name="replace" eval="False"/>
82
<field name="keys" eval="[('action','client_print_multi'),('res_model','account.invoice')]"/>
83
<field name="args" eval="[]"/>
84
<field name="name">Print Invoices</field>
85
<field name="value" eval="'ir.actions.report.xml,'+str(l0)"/>
86
<field name="isobject" eval="True"/>
87
<field name="replace" eval="False"/>
96
.. i18n: .. code-block:: python
98
.. i18n: def ir_set(cr, uid, key, key2, name, models, value, replace=True, isobject=False, meta=None)
100
.. code-block:: python
102
def ir_set(cr, uid, key, key2, name, models, value, replace=True, isobject=False, meta=None)
104
.. i18n: .. code-block:: python
106
.. i18n: def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False)
108
.. code-block:: python
110
def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False)
112
.. i18n: .. code-block:: python
114
.. i18n: def ir_del(cr, uid, id):
116
.. code-block:: python
118
def ir_del(cr, uid, id):
120
.. i18n: :Description of the fields:
122
:Description of the fields:
129
.. i18n: 6. isobject:
130
.. i18n: 7. replace: whether or not the action described should override an existing action or be appended to the list of actions.
139
7. replace: whether or not the action described should override an existing action or be appended to the list of actions.
142
.. i18n: :Using ir_set and ir_get:
144
:Using ir_set and ir_get:
146
.. i18n: .. code-block:: python
150
.. i18n: res = ir.ir_set(cr, uid, key, key2, name, models, value, replace, isobject, meta)
156
.. i18n: if not report.menu_id:
158
.. i18n: ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
162
.. i18n: ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
168
.. i18n: res = ir.ir_get(cr, uid, [('default', self._name), ('field', False)], [('user_id',str(uid))])
172
.. i18n: account_payable = ir.ir_get(cr, uid, [('meta','res.partner'), ('name','account.payable')], opt)[0][2]
176
.. code-block:: python
180
res = ir.ir_set(cr, uid, key, key2, name, models, value, replace, isobject, meta)
186
if not report.menu_id:
188
ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
192
ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
198
res = ir.ir_get(cr, uid, [('default', self._name), ('field', False)], [('user_id',str(uid))])
202
account_payable = ir.ir_get(cr, uid, [('meta','res.partner'), ('name','account.payable')], opt)[0][2]