~openerp-community/openobject-doc/ksa-openobject-doc-6.0

« back to all changes in this revision

Viewing changes to i18n/ru/source/developer/2_4_module_development/4_2_module_descriptor.rst

  • Committer: Don Kirkby
  • Date: 2011-02-21 20:46:11 UTC
  • mfrom: (433.1.53 openobject-doc)
  • Revision ID: donkirkby+launpd@gmail.com-20110221204611-1ykt6dmg4k3gh5dh
[MERGE] revisions 477 to 486 from the 5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. i18n: OpenERP Module Descriptor File : __terp__.py
 
3
.. i18n: ============================================
 
4
..
 
5
 
 
6
OpenERP Module Descriptor File : __terp__.py
 
7
============================================
 
8
 
 
9
.. i18n: Normal Module
 
10
.. i18n: -------------
 
11
..
 
12
 
 
13
Normal Module
 
14
-------------
 
15
 
 
16
.. i18n: In the created module directory, you must add a **__terp__.py** file. This file, which must be in Python format, is responsible to
 
17
..
 
18
 
 
19
In the created module directory, you must add a **__terp__.py** file. This file, which must be in Python format, is responsible to
 
20
 
 
21
.. i18n:    1. determine the XML files that will be parsed during the initialization of the server, and also to
 
22
.. i18n:    2. determine the dependencies of the created module.
 
23
..
 
24
 
 
25
   1. determine the XML files that will be parsed during the initialization of the server, and also to
 
26
   2. determine the dependencies of the created module.
 
27
 
 
28
.. i18n: This file must contain a Python dictionary with the following values:
 
29
..
 
30
 
 
31
This file must contain a Python dictionary with the following values:
 
32
 
 
33
.. i18n: **name**
 
34
..
 
35
 
 
36
**name**
 
37
 
 
38
.. i18n:     The (Plain English) name of the module.
 
39
..
 
40
 
 
41
    The (Plain English) name of the module.
 
42
 
 
43
.. i18n: **version**
 
44
..
 
45
 
 
46
**version**
 
47
 
 
48
.. i18n:     The version of the module.
 
49
..
 
50
 
 
51
    The version of the module.
 
52
 
 
53
.. i18n: **description**
 
54
..
 
55
 
 
56
**description**
 
57
 
 
58
.. i18n:     The module description (text).
 
59
..
 
60
 
 
61
    The module description (text).
 
62
 
 
63
.. i18n: **author**
 
64
..
 
65
 
 
66
**author**
 
67
 
 
68
.. i18n:     The author of the module.
 
69
..
 
70
 
 
71
    The author of the module.
 
72
 
 
73
.. i18n: **website**
 
74
..
 
75
 
 
76
**website**
 
77
 
 
78
.. i18n:     The website of the module.
 
79
..
 
80
 
 
81
    The website of the module.
 
82
 
 
83
.. i18n: **license**
 
84
..
 
85
 
 
86
**license**
 
87
 
 
88
.. i18n:     The license of the module (default:GPL-2).
 
89
..
 
90
 
 
91
    The license of the module (default:GPL-2).
 
92
 
 
93
.. i18n: **depends**
 
94
..
 
95
 
 
96
**depends**
 
97
 
 
98
.. i18n:     List of modules on which this module depends. The base module must almost always be in the dependencies because some necessary data for the views, reports, ... are in the base module.
 
99
..
 
100
 
 
101
    List of modules on which this module depends. The base module must almost always be in the dependencies because some necessary data for the views, reports, ... are in the base module.
 
102
 
 
103
.. i18n: **init_xml**
 
104
..
 
105
 
 
106
**init_xml**
 
107
 
 
108
.. i18n:     List of .xml files to load when the server is launched with the "--init=module" argument. Filepaths must be relative to the directory where the module is. OpenERP XML File Format is detailed in this section.
 
109
..
 
110
 
 
111
    List of .xml files to load when the server is launched with the "--init=module" argument. Filepaths must be relative to the directory where the module is. OpenERP XML File Format is detailed in this section.
 
112
 
 
113
.. i18n: **update_xml**
 
114
..
 
115
 
 
116
**update_xml**
 
117
 
 
118
.. i18n:     List of .xml files to load when the server is launched with the "--update=module" launched. Filepaths must be relative to the directory where the module is. OpenERP XML File Format is detailed in this section.
 
119
..
 
120
 
 
121
    List of .xml files to load when the server is launched with the "--update=module" launched. Filepaths must be relative to the directory where the module is. OpenERP XML File Format is detailed in this section.
 
122
 
 
123
.. i18n: **installable**
 
124
..
 
125
 
 
126
**installable**
 
127
 
 
128
.. i18n:     True or False. Determines if the module is installable or not.
 
129
..
 
130
 
 
131
    True or False. Determines if the module is installable or not.
 
132
 
 
133
.. i18n: **active**
 
134
..
 
135
 
 
136
**active**
 
137
 
 
138
.. i18n:     True or False (default: False). Determines the modules that are installed on the database creation.
 
139
..
 
140
 
 
141
    True or False (default: False). Determines the modules that are installed on the database creation.
 
142
 
 
143
.. i18n: Example
 
144
.. i18n: +++++++
 
145
..
 
146
 
 
147
Example
 
148
+++++++
 
149
 
 
150
.. i18n: Here is an example of __terp__.py file for the *product* module:
 
151
..
 
152
 
 
153
Here is an example of __terp__.py file for the *product* module:
 
154
 
 
155
.. i18n: .. code-block:: python
 
156
.. i18n: 
 
157
.. i18n:     {
 
158
.. i18n:         "name" : "Products & Pricelists",
 
159
.. i18n:         "version" : "1.1",
 
160
.. i18n:         "author" : "Open",
 
161
.. i18n:         "category" : "Generic Modules/Inventory Control",
 
162
.. i18n:         "depends" : ["base", "account"],
 
163
.. i18n:         "init_xml" : [],
 
164
.. i18n:         "demo_xml" : ["product_demo.xml"],
 
165
.. i18n:         "update_xml" : ["product_data.xml","product_report.xml", "product_wizard.xml","product_view.xml", "pricelist_view.xml"],
 
166
.. i18n:         "installable": True,
 
167
.. i18n:         "active": True
 
168
.. i18n:     }
 
169
..
 
170
 
 
171
.. code-block:: python
 
172
 
 
173
    {
 
174
        "name" : "Products & Pricelists",
 
175
        "version" : "1.1",
 
176
        "author" : "Open",
 
177
        "category" : "Generic Modules/Inventory Control",
 
178
        "depends" : ["base", "account"],
 
179
        "init_xml" : [],
 
180
        "demo_xml" : ["product_demo.xml"],
 
181
        "update_xml" : ["product_data.xml","product_report.xml", "product_wizard.xml","product_view.xml", "pricelist_view.xml"],
 
182
        "installable": True,
 
183
        "active": True
 
184
    }
 
185
 
 
186
.. i18n: The files that must be placed in init_xml are the ones that relate to the workflow definition, data to load at the installation of the software and the data for the demonstrations.
 
187
..
 
188
 
 
189
The files that must be placed in init_xml are the ones that relate to the workflow definition, data to load at the installation of the software and the data for the demonstrations.
 
190
 
 
191
.. i18n: The files in **update_xml** concern: views, reports and wizards.
 
192
..
 
193
 
 
194
The files in **update_xml** concern: views, reports and wizards.
 
195
 
 
196
.. i18n: Profile Module
 
197
.. i18n: --------------
 
198
..
 
199
 
 
200
Profile Module
 
201
--------------
 
202
 
 
203
.. i18n: The purpose of a profile is to initialize OpenERP with a set of modules directly after the database has been created. A profile is a special kind of module that contains no code, only *dependencies on other modules*.
 
204
..
 
205
 
 
206
The purpose of a profile is to initialize OpenERP with a set of modules directly after the database has been created. A profile is a special kind of module that contains no code, only *dependencies on other modules*.
 
207
 
 
208
.. i18n: In order to create a profile, you only have to create a new directory in server/addons (you *should* call this folder profile_modulename), in which you put an *empty* __init__.py file (as every directory Python imports must contain an __init__.py file), and a __terp__.py whose structure is as follows :
 
209
..
 
210
 
 
211
In order to create a profile, you only have to create a new directory in server/addons (you *should* call this folder profile_modulename), in which you put an *empty* __init__.py file (as every directory Python imports must contain an __init__.py file), and a __terp__.py whose structure is as follows :
 
212
 
 
213
.. i18n: .. code-block:: python
 
214
.. i18n: 
 
215
.. i18n:     {
 
216
.. i18n:          "name":"''Name of the Profile'',
 
217
.. i18n:          "version":"''Version String''",
 
218
.. i18n:          "author":"''Author Name''",
 
219
.. i18n:          "category":"Profile",
 
220
.. i18n:          "depends":[''List of the modules to install with the profile''],
 
221
.. i18n:          "demo_xml":[],
 
222
.. i18n:          "update_xml":[],
 
223
.. i18n:          "active":False,
 
224
.. i18n:          "installable":True,
 
225
.. i18n:     }
 
226
..
 
227
 
 
228
.. code-block:: python
 
229
 
 
230
    {
 
231
         "name":"''Name of the Profile'',
 
232
         "version":"''Version String''",
 
233
         "author":"''Author Name''",
 
234
         "category":"Profile",
 
235
         "depends":[''List of the modules to install with the profile''],
 
236
         "demo_xml":[],
 
237
         "update_xml":[],
 
238
         "active":False,
 
239
         "installable":True,
 
240
    }
 
241
 
 
242
.. i18n: Example
 
243
.. i18n: +++++++
 
244
..
 
245
 
 
246
Example
 
247
+++++++
 
248
 
 
249
.. i18n: Here's the code of the file
 
250
.. i18n: server/bin/addons/profile_manufacturing/__terp__.py, which corresponds to the
 
251
.. i18n: manufacturing industry profile in OpenERP.
 
252
..
 
253
 
 
254
Here's the code of the file
 
255
server/bin/addons/profile_manufacturing/__terp__.py, which corresponds to the
 
256
manufacturing industry profile in OpenERP.
 
257
 
 
258
.. i18n: .. code-block:: python
 
259
.. i18n: 
 
260
.. i18n:     {
 
261
.. i18n:          "name":"Manufacturing industry profile",
 
262
.. i18n:          "version":"1.1",
 
263
.. i18n:          "author":"Open",
 
264
.. i18n:          "category":"Profile",
 
265
.. i18n:          "depends":["mrp", "crm", "sale", "delivery"],
 
266
.. i18n:          "demo_xml":[],
 
267
.. i18n:          "update_xml":[],
 
268
.. i18n:          "active":False,
 
269
.. i18n:          "installable":True,
 
270
.. i18n:     }
 
271
..
 
272
 
 
273
.. code-block:: python
 
274
 
 
275
    {
 
276
         "name":"Manufacturing industry profile",
 
277
         "version":"1.1",
 
278
         "author":"Open",
 
279
         "category":"Profile",
 
280
         "depends":["mrp", "crm", "sale", "delivery"],
 
281
         "demo_xml":[],
 
282
         "update_xml":[],
 
283
         "active":False,
 
284
         "installable":True,
 
285
    }