~clearcorp-drivers/openobject-doc/5.0-ccorp

« back to all changes in this revision

Viewing changes to i18n/ru/source/book/8/8_20_Config/8_20_Config_import_export.rst

  • Committer: Sergei Kostigoff
  • Date: 2011-05-15 06:21:50 UTC
  • Revision ID: sergei@d1015-20110515062150-5ibvovsvwyo6hyx5
Chapter 8, part 1 - 8_20_Config
Plus minot changes/editorials

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
.. i18n: ============================
13
13
..
14
14
 
15
 
Importing and exporting data
16
 
============================
 
15
Импорт и экспорт данных
 
16
=========================
17
17
 
18
 
.. i18n: Every form in Open ERP has a standard mechanism for importing data from a CSV file through the client user interface. 
 
18
.. i18n: Every form in OpenERP has a standard mechanism for importing data from a CSV file through the client user interface. 
19
19
.. i18n: That's the same format as used in the language translations.
20
20
..
21
21
 
22
 
Every form in Open ERP has a standard mechanism for importing data from a CSV file through the client user interface. 
23
 
That's the same format as used in the language translations.
 
22
Каждая форма в OpenERP обладает стандартным механизмом для импорта данных из файла CSV через клиентский пользовательский интерфейс. Этот же формат используется в языковых переводах.
24
23
 
25
24
.. i18n: .. note:: Forms and Lists
26
25
.. i18n: 
30
29
.. i18n:    :menuselection:`Form --> Import...` and :menuselection:`Form --> Export...`.
31
30
..
32
31
 
33
 
.. note:: Forms and Lists
 
32
.. note:: Формы и списки
34
33
 
35
 
   You have access to the Import and Export functions in the web client on a single form view in read-
36
 
   only mode – you can't reach Import or Export in any other view or when the form is editable.
37
 
   If you're using the GTK client you can find the functions from the top menu 
38
 
   :menuselection:`Form --> Import...` and :menuselection:`Form --> Export...`.
 
34
   В веб-клиенте у вас есть доступ к функциям импорта и экспорта на виде формы в режиме «только для чтения» -- вы не можете использовать импорт и экспорт в каком-либо другом виде или когда форма находится в режиме редактирования. Если вы используете клиент GTK, эти функции находятся в верхнем меню :menuselection:`[Форма --> Импорт...] (Form --> Import...)` и :menuselection:`[Форма --> Экспорт...] (Form --> Export...)`.
39
35
 
40
36
.. i18n: The CSV file format is a text format compatible with most spreadsheet programs (such as OpenOffice
41
37
.. i18n: Calc and Microsoft Excel) and is easily editable as a worksheet. The first line contains the name of
42
38
.. i18n: the field in the form. All the subsequent lines are data, aligned in their respective columns.
43
39
..
44
40
 
45
 
The CSV file format is a text format compatible with most spreadsheet programs (such as OpenOffice
46
 
Calc and Microsoft Excel) and is easily editable as a worksheet. The first line contains the name of
47
 
the field in the form. All the subsequent lines are data, aligned in their respective columns.
 
41
Формат файла CSV -- это текстовый формат, совместимый с большинством программ-табличных калькуляторов (таких, как OpenOffice Calc и Microsoft Excel) и легко редактируется как таблица. Первая строка содержит название полей формы. Все последующие строки -- это данные, помещенные в свои соответствующие столбцы.
48
42
 
49
43
.. i18n: .. index::
50
44
.. i18n:    pair: data; CSV export
57
51
.. i18n: ------------------------------
58
52
..
59
53
 
60
 
Exporting OpenERP data to CSV
 
54
Экспорт данных OpenERP в CSV
61
55
------------------------------
62
56
 
63
57
.. i18n: Start exploring OpenERP's use of the CSV format by exporting a modestly complex set of data,
64
58
.. i18n: the partners and partner addresses in the demonstration data.
65
59
..
66
60
 
67
 
Start exploring OpenERP's use of the CSV format by exporting a modestly complex set of data,
68
 
the partners and partner addresses in the demonstration data.
 
61
Начните экспорт данных OpenERP в формат CSV с ограниченно сложного набора данных, контрагентов и адресов контрагентов в демонстрационных данных.
69
62
 
70
63
.. i18n: Go to :menuselection:`Partners --> Partners` for the list of partners and then scroll to the bottom
71
64
.. i18n: of the list to click the :guilabel:`Export` link. This pops up the :guilabel:`Export Data` dialog box.
72
65
.. i18n: Select the following fields:
73
66
..
74
67
 
75
 
Go to :menuselection:`Partners --> Partners` for the list of partners and then scroll to the bottom
76
 
of the list to click the :guilabel:`Export` link. This pops up the :guilabel:`Export Data` dialog box.
77
 
Select the following fields:
 
68
Перейдите в :menuselection:`[Контрагенты --> Контрагенты] (Partners --> Partners)`, чтобы получить список контрагентов и затем прокрутите экран до нижней части списка, чтобы нажать ссылку :guilabel:`[Экспорт] (Export)`. Это вызовет диалоговое окно :guilabel:`Экспорт данных (Export Data)`. Выберите следующие поля:
78
69
 
79
70
.. i18n: * :guilabel:`Name`,
80
71
.. i18n: 
83
74
.. i18n: * :guilabel:`City` under the :guilabel:`Contacts` menu.
84
75
..
85
76
 
86
 
* :guilabel:`Name`,
87
 
 
88
 
* :guilabel:`Contact Name` under the :guilabel:`Contacts` menu,
89
 
 
90
 
* :guilabel:`City` under the :guilabel:`Contacts` menu.
 
77
* :guilabel:`Название (Name)`,
 
78
 
 
79
* :guilabel:`Имя контакта (Contact Name)` в меню :guilabel:`[Контакты] (Contacts)`,
 
80
 
 
81
* :guilabel:`Город (City)` в меню :guilabel:`[Контакты] (Contacts)`.
91
82
 
92
83
.. i18n: You can either select and add them one at a time, or :kbd:`Ctrl-click` them and add
93
84
.. i18n: the multiple selection - the order in which you 
94
85
.. i18n: select them is the order in which they'll be displayed.
95
86
..
96
87
 
97
 
You can either select and add them one at a time, or :kbd:`Ctrl-click` them and add
98
 
the multiple selection - the order in which you 
99
 
select them is the order in which they'll be displayed.
 
88
Вы можете либо выбирать и добавлять их по одному, либо щелкая левой кнопкой мыши при нажатой клавише :kbd:`<Ctrl>` и добавить затем множественный выбор -- поля будут перечислены в том порядке, в котором вы их выбирали.
100
89
 
101
90
.. i18n: Then click :guilabel:`Export` and save the resulting :file:`data.csv` file somewhere accessible - 
102
91
.. i18n: perhaps your Desktop. You can open that file in a spreadsheet program or a text editor.
103
92
..
104
93
 
105
 
Then click :guilabel:`Export` and save the resulting :file:`data.csv` file somewhere accessible - 
106
 
perhaps your Desktop. You can open that file in a spreadsheet program or a text editor.
 
94
Затем нажмите :guilabel:`[Экспорт] (Export)` и сохраните результирующий файл :file:`data.csv` где-либо в доступном месте, например -- на рабочем столе. Вы можете открыть этот файл в табличном калькуляторе или текстовом редакторе.
107
95
 
108
96
.. i18n: You'll see that you have a list of partners, with the name and city of each partner's contacts
109
97
.. i18n: alongside. In the couple of cases where there is more than one address, the partner name
111
99
.. i18n: that list!
112
100
..
113
101
 
114
 
You'll see that you have a list of partners, with the name and city of each partner's contacts
115
 
alongside. In the couple of cases where there is more than one address, the partner name
116
 
is left out. So it is important to note that the order of entries is critical - do not sort
117
 
that list!
 
102
Теперь у вас есть список контрагентов, с названиями и городами каждого контакта партнера. В нескольких случаях, когда существует более одного адреса, название контрагента опущено. Важно учесть, что теперь порядок следования записей является критическим -- не сортируйте этот список!
118
103
 
119
104
.. i18n: .. tip:: List limits
120
105
.. i18n: 
129
114
.. i18n:    then prepare to wait.
130
115
..
131
116
 
132
 
.. tip:: List limits
 
117
.. tip:: Ограничения списка
133
118
 
134
 
   There is a limit to the number of items you can export in the clients - it's the number
135
 
   you can actually see and that is limited to a maximum of 100 in the web client, but is
136
 
   arbitrary in the GTK client.
 
119
   На количество записей, которые вы можете экспортировать в клиентском ПО, существует ограничение -- это количество записей, которые вы можете реально видеть и ограничение равно максимум 100 записям в веб-клиенте, но может быть произвольно выбрано в клиенте GTK.
137
120
   
138
 
   So if you want to export everything, use the GTK client. Set the export limit to an 
139
 
   arbitrarily large figure (using the :guilabel:`+` button to expose the 
140
 
   :guilabel:`Parameters` and :guilabel:`Limit` fields), then click 
141
 
   :menuselection:`Form --> Export data...`, set up the fields to export, and
142
 
   then prepare to wait.
 
121
   Так что если вы хотите экспортировать все, используйте клиент GTK. Установите лимит экспорта в достаточно большое значение (при помощи кнопки :guilabel:`[+]` для воздействия на :guilabel:`Параметры (Parameters)` и :guilabel:`Ограничения (Limit)`), затем нажмите :menuselection:`[Форма --> Экспорт данных...] (Form --> Export data...)`, задайте поля для экспорта, и приготовьтесь подождать.
143
122
 
144
123
.. i18n: .. index::
145
124
.. i18n:    pair: data; CSV import
152
131
.. i18n: ------------------------------
153
132
..
154
133
 
155
 
Importing CSV data to OpenERP
 
134
Импорт данных CSV в OpenERP
156
135
------------------------------
157
136
 
158
137
.. i18n: Use this export file as a template for an import file by deleting all of the data
160
139
.. i18n: but the principle is the same for a blank database).
161
140
..
162
141
 
163
 
Use this export file as a template for an import file by deleting all of the data
164
 
and using new data (here you'll just import new data alongside the demonstration data,
165
 
but the principle is the same for a blank database).
 
142
Воспользуйтесь этим файлом экспорта как шаблоном для импорта файлов путем удаления всех данных и использованием новых данных (здесь вы можете просто импортировать новые данные рядом с демонстрационными данными, но для пустой базы данных принцип тот же).
166
143
 
167
144
.. i18n: For example, to import partners with several contacts for which you specify a name and a city, you
168
145
.. i18n: would create the following CSV file from the export file:
169
146
..
170
147
 
171
 
For example, to import partners with several contacts for which you specify a name and a city, you
172
 
would create the following CSV file from the export file:
 
148
Например, для импорта контрагентов, с несколькими контактами, для которых вы можете указать имя и город, вы можете создать следующий файл CSV из экспортированного файла:
173
149
 
174
150
.. i18n: .. csv-table:: Example of importing partner address fields
175
151
.. i18n:    :header: "Name", "Contacts/Contact Name", "Contacts/City"
181
157
.. i18n:    "Miles A Minute","",""
182
158
..
183
159
 
184
 
.. csv-table:: Example of importing partner address fields
185
 
   :header: "Name", "Contacts/Contact Name", "Contacts/City"
 
160
.. csv-table:: Пример импорта адресных полей контрагента
 
161
   :header: "Название (Name)", "Контакты/Имена контактов (Contacts/Contact Name)", "Контакты/Город (Contacts/City)"
186
162
   :widths: 12,10,8
187
163
 
188
 
   "Whole Globe Technologies","Graham Global","Athens"
189
 
   "","Wanda World","Rome"
190
 
   "","Emerson Earth","New York"
 
164
   "Whole Globe Technologies","Graham Global","Афины (Athens)"
 
165
   "","Wanda World","Рим (Rome)"
 
166
   "","Emerson Earth","Нью-Йорк (New York)"
191
167
   "Miles A Minute","",""
192
168
 
193
169
.. i18n: From the list of partners, click the :guilabel:`Import` button and then in the 
196
172
.. i18n: but the GTK client requires that you click the :guilabel:`Auto detect` button.
197
173
..
198
174
 
199
 
From the list of partners, click the :guilabel:`Import` button and then in the 
200
 
:guilabel:`Import Data` window click :guilabel:`Open` to search for and import
201
 
the new :file:`data.csv` file. The web client automatically matches column names
202
 
but the GTK client requires that you click the :guilabel:`Auto detect` button.
 
175
В списке контрагентов нажмите кнопку :guilabel:`[Импорт] (Import)` и затем в окне :guilabel:`Импорт данных (Import Data)` нажмите :guilabel:`[Открыть] (Open)` для того, чтобы выбрать и импортировать новый файл :file:`data.csv`. Веб-клиент автоматически ставит соответствие по названиям колонок, но клиент GTK требует нажатия кнопки :guilabel:`[Автоопределение] (Auto detect)`.
203
176
 
204
177
.. i18n: You'll get a dialog box showing that you have imported 2 objects, and you can
205
178
.. i18n: see the new partners and partner addresses when you refresh the list on screen.
206
179
..
207
180
 
208
 
You'll get a dialog box showing that you have imported 2 objects, and you can
209
 
see the new partners and partner addresses when you refresh the list on screen.
 
181
Будет выведено диалоговое окно, показывающее, что вы импортировали 2 объекта, и теперь вы можете увидеть новых контрагентов и адреса контрагентов при обновлении списка на экране.
210
182
 
211
183
.. i18n: .. index::
212
184
.. i18n:    pair: data; CSV structured
219
191
.. i18n: ----------------------------------------------
220
192
..
221
193
 
222
 
The CSV format for complex database structures
223
 
----------------------------------------------
 
194
Формат файла CSV для структур сложных баз данных
 
195
--------------------------------------------------
224
196
 
225
197
.. i18n: When you import data you have to overcome the problem of representing a database structure in \
226
 
.. i18n: ``.csv``\  flat files. To do this, two solutions are possible in Open ERP:
 
198
.. i18n: ``.csv``\  flat files. To do this, two solutions are possible in OpenERP:
227
199
..
228
200
 
229
 
When you import data you have to overcome the problem of representing a database structure in \
230
 
``.csv``\  flat files. To do this, two solutions are possible in Open ERP:
 
201
Когда вы импортируете данные, вам необходимо решить проблему представления структуры базы данных в плоских файлах ``.csv``. Для этого в OpenERP возможны два решения:
231
202
 
232
203
.. i18n: * importing a CSV file that's been structured in a particular way to enable you to load several
233
204
.. i18n:   different database tables from a single file (such as partners and partner contacts in one CSV
237
208
.. i18n:   links between the tables.
238
209
..
239
210
 
240
 
* importing a CSV file that's been structured in a particular way to enable you to load several
241
 
  different database tables from a single file (such as partners and partner contacts in one CSV
242
 
  file, as you have just done above),
 
211
* импорт файла CSV, который был структурирован определенным путем, чтобы дать вам возможность загружать несколько различных таблиц базы данных из одного файла (такого, как контрагенты и адреса контрагентов в одном файле CSV, как вы только что проделали выше),
243
212
 
244
 
* importing several CSV files, each corresponding to a specific database table, that have explicit
245
 
  links between the tables.
 
213
* импорт нескольких файлов CSV, каждый из которых соответствует конкретной таблице базы данных, с заданными явными ссылками между таблицами.
246
214
 
247
215
.. i18n: .. note:: Server-side importing
248
216
.. i18n: 
253
221
.. i18n:    server the column heading names must match the internal names of the fields.
254
222
..
255
223
 
256
 
.. note:: Server-side importing
 
224
.. note:: Импорт на стороне сервера
257
225
 
258
 
   You can also import CSV data in through the server interface. The file format is the same, but
259
 
   column headings differ slightly. When importing through the user interface it checks that the column
260
 
   heading names match the names seen in the forms on the user interface itself. 
261
 
   In contrast, when importing through the 
262
 
   server the column heading names must match the internal names of the fields.
 
226
   Вы можете также импортировать данные CSV при помощи интерфейса сервера. Формат файла остается таким же, но названия столбов немного отличаются. При импорте через пользовательский интерфейс он проверяет, что названия столбцов соответствуют названиям, показанным в формах самого пользовательского интерфейса. При импорте через сервер, названия столбцов должны соответствовать внутренним названиям полей.
263
227
 
264
228
.. i18n: Start by building the header of the CSV file. Open the import tool on the object that you're
265
 
.. i18n: interested in and select the fields that you want to import into your Open ERP database. You must
 
229
.. i18n: interested in and select the fields that you want to import into your OpenERP database. You must
266
230
.. i18n: include every field that's colored in blue because those fields are required (unless you know that they
267
231
.. i18n: get filled by default with an appropriate value), and also any other field that's important to you.
268
232
..
269
233
 
270
 
Start by building the header of the CSV file. Open the import tool on the object that you're
271
 
interested in and select the fields that you want to import into your Open ERP database. You must
272
 
include every field that's colored in blue because those fields are required (unless you know that they
273
 
get filled by default with an appropriate value), and also any other field that's important to you.
 
234
Начните с построения заголовка файла CSV. Откройте инструмент импорта интересующего вас объекта и выберите поля, которые вы хотите импортировать в вашу базу данных OpenERP. вы должны включить каждое поле, которое окрашено в синий цвет, потому что эти поля являются обязательными (если только вы не знаете, что они будут заполнены соответствующим значением по умолчанию), а также все поля, которые для вас важны.
274
235
 
275
236
.. i18n: .. figure::  images/csv_column_select.png
276
237
.. i18n:    :scale: 75
283
244
   :scale: 75
284
245
   :align: center
285
246
 
286
 
   *Selecting fields to import using a CSV file*
 
247
   *Выбор полей для импорта с использованием файла CSV*
287
248
 
288
249
.. i18n: Use the field names as the column names in the first line of your CSV file, adding one field per
289
250
.. i18n: column. If your CSV file has these names in the first line then when you import your CSV file,
290
 
.. i18n: Open ERP will automatically match the column name to the field name of the table. When you've
 
251
.. i18n: OpenERP will automatically match the column name to the field name of the table. When you've
291
252
.. i18n: created your CSV file you'll do that by clicking the :guilabel:`Nothing` button to clear the
292
253
.. i18n: :guilabel:`Fields to Import`, then select your CSV file by browsing for a :guilabel:`File to
293
254
.. i18n: import`, and then clicking the :guilabel:`Auto Detect` button.
294
255
..
295
256
 
296
 
Use the field names as the column names in the first line of your CSV file, adding one field per
297
 
column. If your CSV file has these names in the first line then when you import your CSV file,
298
 
Open ERP will automatically match the column name to the field name of the table. When you've
299
 
created your CSV file you'll do that by clicking the :guilabel:`Nothing` button to clear the
300
 
:guilabel:`Fields to Import`, then select your CSV file by browsing for a :guilabel:`File to
301
 
import`, and then clicking the :guilabel:`Auto Detect` button.
 
257
Используйте названия полей в качестве названий столбцов в первой строке вашего файла CSV, добавляя одно поле на столбец. Если в вашем файле CSV в первой строке будут присутствовать эти названия, то при импорте файла CSV OpenERP будет автоматически устанавливать соответствие названия столбца с названием поля в таблице. Когда вы создадите ваш файл CSV, проделайте, нажав кнопку :guilabel:`[Ничего] (Nothing)`, чтобы очистить :guilabel:`Поля для импорта (Fields to Import)`, затем выберите ваш файл CSV в окне :guilabel:`Файл для импорта (File to import)`, и нажмите кнопку :guilabel:`[Автоопределение] Auto Detect`.
302
258
 
303
259
.. i18n: To import CSV data that matches your database structure, you should distinguish between the following types
304
 
.. i18n: of field in the Open ERP interface:  *many-to-many*  fields (between multiple sources and
 
260
.. i18n: of field in the OpenERP interface:  *many-to-many*  fields (between multiple sources and
305
261
.. i18n: destinations),  *many-to-one*  fields (from multiple sources to a single destination), and  *one-to-
306
262
.. i18n: many*  fields (from a single origin to multiple destinations).
307
263
..
308
264
 
309
 
To import CSV data that matches your database structure, you should distinguish between the following types
310
 
of field in the Open ERP interface:  *many-to-many*  fields (between multiple sources and
311
 
destinations),  *many-to-one*  fields (from multiple sources to a single destination), and  *one-to-
312
 
many*  fields (from a single origin to multiple destinations).
 
265
Для импорта данных CSV, которые соответствуют структуре вашей базы данных, вам надо делать различие между следующими типами полей в интерфейсе OpenERP: поля *многие-ко-многим (many-to-many)*  (между различными источниками и назначениями), поля *многие-к-одному (many-to-one)* (от многих источников к одному назначению), и поля *один-ко-многим (one-to-many)* (от одного источника ко многим назначениям).
313
266
 
314
267
.. i18n: .. note:: Foreground table
315
268
.. i18n: 
325
278
.. i18n:    :guilabel:`child_ids` Partner contacts field in the Partner form.
326
279
..
327
280
 
328
 
.. note:: Foreground table
329
 
 
330
 
   Each of these types is described in relation to a foreground table –
331
 
   the table whose entry form you're viewing and whose entries would be updated by a simple CSV file.
332
 
 
333
 
   Just because one of these relation fields appears on the foreground table, does not mean that there
334
 
   is an inverse field on the related table – but there may be.
335
 
 
336
 
   So there is *no* one-to-many field in the User form to reflect the many-to-one :guilabel:`user_id` Salesman field in
337
 
   the Partner form,
338
 
   but there *is* a many-to-one :guilabel:`partner_id` Partner field in the Partner contact form to reflect the one-to-many
339
 
   :guilabel:`child_ids` Partner contacts field in the Partner form.
 
281
.. note:: Активная таблица
 
282
 
 
283
   Каждый из этих типов описан в отношении к активной таблице -- т.е. той таблице, форму ввода которой вы и записи которой будут изменены простым файлом CSV.
 
284
 
 
285
   То, что одно из этих полей с отношением присутствует в активной таблице, не означает, что существует обратное поле в таблице, к которой построено отношение -- но такое поле может и существовать.
 
286
 
 
287
   Так, в форме Пользователь (User) *не существует* поля типа один-ко-многим (one-to-many) для отображения поля :guilabel:`user_id` Продавец (Salesman) типа многие-к-одному (many-to-one) :guilabel:`user_id` из формы Контрагента (Partner), но *существует* поле Контрагент(Partner) типа много-к-одному (many-to-one) :guilabel:`partner_id` на форме Контакт контрагента (Partner contact) для отображения поля Контакты контрагента (Partner contacts) из формы Контрагент (Partner) для отображения поля типа один-ко-многим (one-to-many) :guilabel:`child_ids`.
340
288
 
341
289
.. i18n: Have a look at the screenshots below to see the differences.
342
290
..
343
291
 
344
 
Have a look at the screenshots below to see the differences.
 
292
Чтобы увидеть различия, посмотрите на иллюстрации ниже, показывающие экраны.
345
293
 
346
294
.. i18n: .. figure::  images/csv_many2one.png
347
295
.. i18n:    :scale: 75
354
302
   :scale: 75
355
303
   :align: center
356
304
 
357
 
   *A many-to-one field: a salesperson linked to a partner*
 
305
   *Поле многие-к-одному (many-to-one): продавец связан с контрагентом*
358
306
 
359
307
.. i18n: .. figure::  images/csv_many2many.png
360
308
.. i18n:    :scale: 75
367
315
   :scale: 75
368
316
   :align: center
369
317
 
370
 
   *A many-to-many field: partner categories*
 
318
   *Поле многие-ко-многим (many-to-many): категории контрагентов*
371
319
 
372
320
.. i18n: .. figure::  images/csv_one2many.png
373
321
.. i18n:    :scale: 75
380
328
   :scale: 75
381
329
   :align: center
382
330
 
383
 
   *A one-to-many field: partner contacts*
 
331
   *Поле один-ко-многим (one-to-many): контакты контрагента*
384
332
 
385
333
.. i18n: All of the other fields are coded in the CSV file as just one text string in each column.
386
334
..
387
335
 
388
 
All of the other fields are coded in the CSV file as just one text string in each column.
 
336
Все остальные поля вносятся в файл CSV просто как одна текстовая строка в каждом столбце.
389
337
 
390
338
.. i18n: .. index:: 
391
339
.. i18n:    pair: relation; field
398
346
.. i18n: ^^^^^^^^^^^^^^^^^^
399
347
..
400
348
 
401
 
Many-to-one fields
402
 
^^^^^^^^^^^^^^^^^^
 
349
Поля многие-к-одному
 
350
^^^^^^^^^^^^^^^^^^^^^
403
351
 
404
352
.. i18n: Many-to-one fields represent a relationship between the foreground table and another table in the
405
 
.. i18n: database where the foreground table has a single entry for the other table. Open ERP tries to link 
 
353
.. i18n: database where the foreground table has a single entry for the other table. OpenERP tries to link 
406
354
.. i18n: the new record in the foreground table with the field in the other table by matching the field values.
407
355
..
408
356
 
409
 
Many-to-one fields represent a relationship between the foreground table and another table in the
410
 
database where the foreground table has a single entry for the other table. Open ERP tries to link 
411
 
the new record in the foreground table with the field in the other table by matching the field values.
 
357
Поля типа многие-к-одному (many-to-one) представляют отношение между активной таблицей и другой таблицей в базе данных, где активная таблица имеет одну запись для для другой таблицы. OpenERP пытается связать новую запись в активной таблице с полем в другой таблице путем сравнения значений поля.
412
358
 
413
359
.. i18n: .. tip:: Field identifiers 
414
360
.. i18n: 
422
368
.. i18n:    instead of the product name). 
423
369
.. i18n:    You then don't need any complex conversion to create links between the two tables.
424
370
.. i18n:    
425
 
.. i18n:    This considerably simplifies the importation of another database into Open ERP.
 
371
.. i18n:    This considerably simplifies the importation of another database into OpenERP.
426
372
.. i18n:    You just create a linking ``id`` column for each table that you're importing
427
373
.. i18n:    that contains the identifier used in the first table.
428
374
..
429
375
 
430
 
.. tip:: Field identifiers 
431
 
 
432
 
   If you're working on the server side you can use identifiers rather than the names of resources
433
 
   to link tables. To do this you import the
434
 
   first file (for example, Products) with a column named :guilabel:`id` in your CSV file that contains a
435
 
   unique identifier for each product. This could be an incrementing number.
436
 
 
437
 
   When you import other files which link to the first table, you can use the identifier in preference
438
 
   to the names (so, for example, when you're saving inventory you can use \ ``product:id``\ 
439
 
   instead of the product name). 
440
 
   You then don't need any complex conversion to create links between the two tables.
 
376
.. tip:: Идентификаторы полей
 
377
 
 
378
   Если вы работаете на стороне сервера, вам надо использовать идентификаторы, а не названия ресурсов для связи таблиц. Чтобы сделать это, импортируйте первый файл (например, Продукты (Products)) с колонкой, которая называется :guilabel:`id` в вашем файле CSV, содержащем уникальный идентификатор для каждого продукта. Это может быть увеличивающееся число.
 
379
 
 
380
   Когда вы импортируете другие файлы, которые связаны с первой таблицей, вам будет предпочтительнее использовать идентификатор, а не название (так, например, когда вы сохраняете результаты инвентаризации, вы можете использовать ``product:id``, а не название продукта). После этого вам не требуется никаких сложных преобразований для создания связей между таблицами.
441
381
   
442
 
   This considerably simplifies the importation of another database into Open ERP.
443
 
   You just create a linking ``id`` column for each table that you're importing
444
 
   that contains the identifier used in the first table.
 
382
   Это намного облегчает импорт другой базы данных в OpenERP. Вы сначала для каждой импортируемой вами таблицы создаете связующий столбец ``id`` для каждой импортируемой вами таблицы, который содержит идентификатор, используемый в первой таблице.
445
383
 
446
384
.. i18n: Many-to-many fields
447
385
.. i18n: ^^^^^^^^^^^^^^^^^^^
448
386
..
449
387
 
450
 
Many-to-many fields
451
 
^^^^^^^^^^^^^^^^^^^
 
388
Поля многие-ко-многим
 
389
^^^^^^^^^^^^^^^^^^^^^^^
452
390
 
453
391
.. i18n: Many-to-many fields are handled just like many-to-one fields in trying to recreate the relationship
454
392
.. i18n: between tables: either by searching for names or by using identifiers.
455
393
..
456
394
 
457
 
Many-to-many fields are handled just like many-to-one fields in trying to recreate the relationship
458
 
between tables: either by searching for names or by using identifiers.
 
395
Поля типа многие-ко-многим обрабатываются также, как и поля типа многие-к-одному в попытке воссоздать отношения между таблицами: либо поиском по имени, либо с использованием идентификаторов.
459
396
 
460
397
.. i18n: There are several possible values in a single many-to-many field. Therefore a partner can be given
461
398
.. i18n: several associated categories. You must separate the different values with a comma.
462
399
..
463
400
 
464
 
There are several possible values in a single many-to-many field. Therefore a partner can be given
465
 
several associated categories. You must separate the different values with a comma.
 
401
В одном поле типа многие-ко-многим может содержаться несколько значений. Следовательно, контрагент может обладать несколькими ассоциированными категориями. Вы должны разделять различные значения запятыми.
466
402
 
467
403
.. i18n: One-to-many fields
468
404
.. i18n: ^^^^^^^^^^^^^^^^^^
469
405
..
470
406
 
471
 
One-to-many fields
472
 
^^^^^^^^^^^^^^^^^^
 
407
Поля один-ко-многим
 
408
^^^^^^^^^^^^^^^^^^^^^
473
409
 
474
410
.. i18n: One-to-many fields are a bit different. Take as an example the :guilabel:`Partner Contacts` field in
475
411
.. i18n: the Partner form, which contains all of the linked contacts.
476
412
..
477
413
 
478
 
One-to-many fields are a bit different. Take as an example the :guilabel:`Partner Contacts` field in
479
 
the Partner form, which contains all of the linked contacts.
 
414
Поля типа один-ко-многим немного другие. Рассмотрим в качестве примера поле :guilabel:`Контакты контрагента (Partner Contacts)` на форме партнера, которое содержит все связанные контакты.
480
415
 
481
416
.. i18n: To import such a field you don't have to link to an existing entry in another table, but can instead
482
417
.. i18n: create and link to several partner contacts using the same file. You can then specify several values
485
420
.. i18n: many/field_linked-object``\  . The partner data you imported earlier took that form.
486
421
..
487
422
 
488
 
To import such a field you don't have to link to an existing entry in another table, but can instead
489
 
create and link to several partner contacts using the same file. You can then specify several values
490
 
for different fields linked to that object by the one-to-many field. Each field must be put in a
491
 
column of the table, and the title of that column must be expressed in the form \ ``field_one-to-
492
 
many/field_linked-object``\  . The partner data you imported earlier took that form.
 
423
Чтобы импортировать такое поле, вам не нужно связывать его с существующей записью в другой таблице, но вы можете создать и связать несколько контактов партнера, используя тот самый же файл. Вы можете затем указать несколько значений для различных полей, связанных с этим объектом полем типа один-ко-многим. Каждое поле должно быть помещено в столбец таблицы, и заголовок этого столбца должен быть выражен в виде ``field_one-to-many/field_linked-object``. Данные партнера, которые вы импортировали ранее, были оформлены именно таким образом.
493
424
 
494
425
.. i18n: .. note::  Symmetry in relation fields
495
426
.. i18n: 
504
435
.. i18n:          one form).
505
436
..
506
437
 
507
 
.. note::  Symmetry in relation fields
508
 
 
509
 
        Depending on the structure of your data it can be easier to use the one-to-many form or the many-
510
 
        to-one form in relating two tables, so long as the relevant fields exist on both ends of the relationship.
511
 
 
512
 
        For example, you can:
513
 
 
514
 
        * import one partner with different contact in a single file (one-to-many),
515
 
 
516
 
        * import the partners first, and then contacts with the field linking to the partner in a many-to-
517
 
          one form).
 
438
.. note::  Симметрия в полях отношений
 
439
 
 
440
        В зависимости от структуры ваших данных использовать форму один-ко-многим или многие-к-одному в отношениях двух таблиц может быть легче, до тех пор, пока поля отношений существуют на обеих сторонах отношений.
 
441
 
 
442
        Например, вы можете:
 
443
 
 
444
        * импортировать одного контрагента с различными контактами в одном файле (один-ко-многим),
 
445
 
 
446
        * вначале импортировать контрагентов, а затем контакты с полем, связанным с контрагентом в формате многие-к-одному).
518
447
 
519
448
.. i18n: .. index::
520
449
.. i18n:    single: data; import example
527
456
.. i18n: ------------------------------------
528
457
..
529
458
 
530
 
Another example of a CSV import file
 
459
Другой пример файла импорта CSV
531
460
------------------------------------
532
461
 
533
462
.. i18n: To illustrate data importing, you can see another example below. First import partner
537
466
.. i18n: use *many-to-many* relations). You must create new categories in a separate step.
538
467
..
539
468
 
540
 
To illustrate data importing, you can see another example below. First import partner
541
 
categories, and then import some partners and their contacts along with links to the categories
542
 
just created. Although you can create new contacts at the same time as creating partners (because
543
 
you can do this for *one-to-many* relations), you can't create new categories this way (because they
544
 
use *many-to-many* relations). You must create new categories in a separate step.
 
469
Чтобы проиллюстрировать импорт данных, рассмотрим ниже еще один пример. Вначале импортируем категории контрагентов, а затем импортируем нескольких контрагентов и их контакты вместе со ссылками на только что созданные категории категории. Хотя вы можете создавать новые контакты одновременно с созданием контрагентов, (потому что вы можете делать это для отношений *один-ко-многим*), вы не можете создать этим путем новые категории (потому что они используют отношения *многие-ко-многим*). Вы должны создать новые категории в отдельном шаге.
545
470
 
546
471
.. i18n: Partner categories
547
472
.. i18n: ^^^^^^^^^^^^^^^^^^
548
473
.. i18n: Start by creating partner categories in a CSV file:
549
474
..
550
475
 
551
 
Partner categories
552
 
^^^^^^^^^^^^^^^^^^
553
 
Start by creating partner categories in a CSV file:
 
476
Категории контрагентов
 
477
^^^^^^^^^^^^^^^^^^^^^^^^
 
478
Начните путем создания категорий контрагентов в файле CSV:
554
479
 
555
480
.. i18n: #. Create the following table in your spreadsheet program:
556
481
..
557
482
 
558
 
#. Create the following table in your spreadsheet program:
 
483
#. Создайте следующую таблицу в вашем табличном калькуляторе:
559
484
 
560
485
.. i18n:    .. csv-table:: Partner categories file
561
486
.. i18n:       :header: "","Column A","Column B"
576
501
.. i18n:    blank then the category sits at the top level.
577
502
..
578
503
 
579
 
   .. csv-table:: Partner categories file
580
 
      :header: "","Column A","Column B"
 
504
   .. csv-table:: Файл категорий контрагентов
 
505
      :header: "","Столбец A (Column A)","Столбец B (Column B)"
581
506
      :widths: 5,10,10
582
507
 
583
 
      "Line 1","Category Name","Parent Category"
584
 
      "Line 2","Quality",""
585
 
      "Line 3","Gold","Quality"
586
 
      "Line 4","Silver","Quality"
587
 
      "Line 5","Bronze","Quality"
588
 
 
589
 
   On the first line, :guilabel:`Category Name` and :guilabel:`Parent Category` are
590
 
   the column titles that correspond to field names in the :guilabel:`Partner
591
 
   category` form.
592
 
 
593
 
   :guilabel:`Column A` is for the different partner categories and :guilabel:`Column
594
 
   B` indicates if that category has a parent category. If :guilabel:`Column B` is
595
 
   blank then the category sits at the top level.
 
508
      "Строка 1 (Line 1)","Название категории (Category Name)","Родительская категория (Parent Category)"
 
509
      "Строка 2 (Line 2)","Качество (Quality)",""
 
510
      "Строка 3 (Line 3)","Золотой (Gold)","Качество (Quality)"
 
511
      "Строка 4 (Line 4)","Серебряный (Silver)","Качество (Quality)"
 
512
      "Строка 5 (Line 5)","Бронзовый (Bronze)","Качество (Quality)"
 
513
 
 
514
   В первой строке, :guilabel:`Название категории (Category Name)` и :guilabel:`Родительская категория (Parent Category)` -- это заголовки столбцов, которые соответствуют именам полей в форме :guilabel:`Категории контрагентов (Partner category)`.
 
515
 
 
516
   :guilabel:`Столбец A (Column A)` содержит различные категории контрагентов, а :guilabel:`Столбец B (Column B)` показывает, имеется ли родительская категория для данной категории. Если :guilabel:`Столбец B (Column B)` пуст, то категория располагается на верхнем уровне.
596
517
 
597
518
.. i18n: #. Save spreadsheet file in CSV format – separated by commas – and name the file 
598
519
.. i18n:    \ ``categories.csv``\.
599
520
.. i18n: 
600
 
.. i18n: #. In Open ERP, select :menuselection:`Partners --> Configuration --> Categories --> Edit
 
521
.. i18n: #. In OpenERP, select :menuselection:`Partners --> Configuration --> Categories --> Edit
601
522
.. i18n:    Categories`.
602
523
.. i18n: 
603
524
.. i18n: #. Click :guilabel:`Import` (to the bottom left of the list) to bring up the :guilabel:`Import Data` dialog
615
536
.. i18n:    including the new \ ``Quality``\  branch that you loaded.
616
537
..
617
538
 
618
 
#. Save spreadsheet file in CSV format – separated by commas – and name the file 
619
 
   \ ``categories.csv``\.
620
 
 
621
 
#. In Open ERP, select :menuselection:`Partners --> Configuration --> Categories --> Edit
622
 
   Categories`.
623
 
 
624
 
#. Click :guilabel:`Import` (to the bottom left of the list) to bring up the :guilabel:`Import Data` dialog
625
 
   box, in which you'll find the ist of fields that can be imported.
626
 
 
627
 
#. Click :guilabel:`Browse...` on the :guilabel:`File to import` field and select the CSV file you
628
 
   just created, \ ``categories.csv``\   Then click :guilabel:`Auto Detect` to atch the column names
629
 
   in the CSV file with the field names available in:guilabel:`Partner Categories`.
630
 
 
631
 
#. Click :guilabel:`Import` at the bottom-right of the dialog box to load your data. You should get
632
 
   the message \ ``4 objects imported``\  in a new dialog box. Close both this and the
633
 
   :guilabel:`Import Data` dialog box to return to the original page.
634
 
 
635
 
#. Click :menuselection:`Partners --> Partners by category` to view the tree of categories,
636
 
   including the new \ ``Quality``\  branch that you loaded.
 
539
#. Сохраните таблицу в файл CSV -- разделенный запятыми -- и назовите файл ``categories.csv``.
 
540
 
 
541
#. В OpenERP выберите :menuselection:`[Контрагенты --> Настройки --> Категории --> Изменить категории] (Partners --> Configuration --> Categories --> Edit Categories)`.
 
542
 
 
543
#. Нажмите :guilabel:`[Импорт] Import` (внизу слева от списка), чтоыб вызвать диалоговое окно :guilabel:`[Импорт данных] Import Data`, в котором вы увидите список полей для импорта.
 
544
 
 
545
#. Нажмите :guilabel:`[Просмотр] Browse...` в поле :guilabel:`[Файл для импорта] File to import` и выберите файл CSV, который вы только что создали, ``categories.csv``. Затем нажмите :guilabel:`[Автоопределение] Auto Detect` для поиска соответствия названий столбцов в файле CSV с именами полей, доступных в :guilabel:`Категории контрагентов (Partner Categories)`.
 
546
 
 
547
#. Нажмите :guilabel:`[Импорт] (Import)` справа внизу диалогового окна для загрузки ваших данных. Вы должны получить сообщение ``4 объекта импортировано (4 objects imported)`` в носом диалоговом окне. Закройте оба окна -- это и диалоговое окно :guilabel:`Импорт данных (Import Data)`, чтобы вернуться к исходной странице.
 
548
 
 
549
#. Нажмите :menuselection:`[Контрагенты --> Контрагенты по категориям] (Partners --> Partners by category)`, чтобы увидеть древо категорий, включая новую ветку ``Качество (Quality)``, которую вы загрузили.
637
550
 
638
551
.. i18n: New partners
639
552
.. i18n: ^^^^^^^^^^^^
640
553
..
641
554
 
642
 
New partners
643
 
^^^^^^^^^^^^
 
555
Новые контрагенты
 
556
^^^^^^^^^^^^^^^^^^^
644
557
 
645
558
.. i18n: Here's how to create new partners with more than one contact, as you did before, and how to link them to these new categories:
646
559
..
647
560
 
648
 
Here's how to create new partners with more than one contact, as you did before, and how to link them to these new categories:
 
561
Теперь о том, как создать новых контрагентов с более, чем одним контактом, как вы делали ранее, и как связать их с этими новыми категориями:
649
562
 
650
563
.. i18n: #. Enter the table below into your spreadsheet program.
651
564
..
652
565
 
653
 
#. Enter the table below into your spreadsheet program.
 
566
#. Создайте в вашем табличном калькуляторе следующую таблицу.
654
567
 
655
568
.. i18n:    .. csv-table:: Partner data file - partners.csv
656
569
.. i18n:       :header: "","Column A","Column B","Column C","Column D"
662
575
.. i18n:       "Line 4","Tiny sprl","","Fabien Pinckaers","Administrator"
663
576
..
664
577
 
665
 
   .. csv-table:: Partner data file - partners.csv
666
 
      :header: "","Column A","Column B","Column C","Column D"
 
578
   .. csv-table:: Файл данных контрагентов - partners.csv
 
579
      :header: "","Столбец A (Column A)","Столбец B (Column B)","Столбец C (Column C)","Столбец D (Column D)"
667
580
      :widths: 5,10,10,10,10
668
581
 
669
 
      "Line 1","Name","Categories","Contacts/Contact Name","Dedicated Salesman"
670
 
      "Line 2","Black Advertising","Silver,Gold","George Black","Administrator"
671
 
      "Line 3","","","Jean Green",""
672
 
      "Line 4","Tiny sprl","","Fabien Pinckaers","Administrator"
 
582
      "Строка 1 (Line 1)","Название (Name)","Категории (Categories)","Контакты/Имя контакта (Contacts/Contact Name)","Выделенный продавец (Dedicated Salesman)"
 
583
      "Строка 2 (Line 2)","Black Advertising","Silver,Gold","George Black","Administrator"
 
584
      "Строка 3 (Line 3)","","","Jean Green",""
 
585
      "Строка 4 (Line 4)","Tiny sprl","","Fabien Pinckaers","Administrator"
673
586
 
674
587
.. i18n: #. The second line corresponds to the creation of a new partner, with two existing categories, that
675
588
.. i18n:    has two contacts and is linked to a salesman.
684
597
.. i18n:    (``Silver`` and ``Gold``).
685
598
..
686
599
 
687
 
#. The second line corresponds to the creation of a new partner, with two existing categories, that
688
 
   has two contacts and is linked to a salesman.
689
 
 
690
 
#. Save the file using the name \ ``partners.csv``\
691
 
 
692
 
#. In OpenERP, select :menuselection:`Partners --> Partners` then import the file that you've just
693
 
   saved. You'll get a message confirming that you've imported and saved the data.
694
 
 
695
 
#. Verify that you've imported the data. A new partner should have appeared (``NoirAdvertising``),
696
 
   with a salesman (``Administrator``), two contacts (``George Black`` and ``Jean Green``) and two categories
697
 
   (``Silver`` and ``Gold``).
 
600
#. Вторая строка соответствует созданию нового контрагента, с двумя существующими категориями, у которого есть два контакта и который связан с продавцом.
 
601
 
 
602
#. Сохраните файл под именем ``partners.csv``.
 
603
 
 
604
#. В OpenERP выберите :menuselection:`[Контрагенты --> Контрагенты] (Partners --> Partners)`, затем импортируйте только что сохраненный вами файл. Будет выведено сообщение, подтверждающее что ваши данные импортированы и сохранены.
 
605
 
 
606
#. Убедитесь, что данные импортированы успешно. Должен появиться новый контрагент (``NoirAdvertising``), с продавцом (``Administrator``), двумя контактами (``George Black`` и ``Jean Green``) и двумя категориями (``Silver`` and ``Gold``).
698
607
 
699
608
.. i18n: .. index::
700
609
.. i18n:    single: data, export in other forms
706
615
.. index::
707
616
   single: data, export in other forms
708
617
   
709
 
Exporting data in other forms
710
 
-----------------------------
 
618
Экспорт данных в других видах
 
619
-------------------------------
711
620
 
712
 
.. i18n: Open ERP's generic export mechanism lets you easily export any of your data to any location on your
 
621
.. i18n: OpenERP's generic export mechanism lets you easily export any of your data to any location on your
713
622
.. i18n: system. You're not restricted to what you can export, although you can restrict who can export that
714
623
.. i18n: data using the rights management facilities discussed above.
715
624
..
716
625
 
717
 
Open ERP's generic export mechanism lets you easily export any of your data to any location on your
718
 
system. You're not restricted to what you can export, although you can restrict who can export that
719
 
data using the rights management facilities discussed above.
 
626
Общий механизм экспорта OpenERP позволяет вам легко экспортировать любые ваши данные в любое место вашей системы. Ограничения, что вы хотите экспортировать, не существует, однако вы можете установить ограничение, кто может экспортировать определенные данные, используя механизмы управления правами, описанные выше.
720
627
 
721
628
.. i18n: You can use this to export your data into spreadsheets or into other systems such as specialist
722
629
.. i18n: accounts packages. The export format is usually in the CSV format but you can also connect directly
723
630
.. i18n: to Microsoft Excel using Microsoft's COM mechanism.
724
631
..
725
632
 
726
 
You can use this to export your data into spreadsheets or into other systems such as specialist
727
 
accounts packages. The export format is usually in the CSV format but you can also connect directly
728
 
to Microsoft Excel using Microsoft's COM mechanism.
 
633
Вы использовать механизм для экспорта ваших данных в табличные файлы или иные системы, такие как специализированные бухгалтерские пакеты. Обычно формат экспорта -- это формат CSV, но вы можете также подсоединяться непосредственно к Microsoft Excel при помощи механизма COM Microsoft.
729
634
 
730
635
.. i18n: .. tip:: Access to the database
731
636
.. i18n: 
732
 
.. i18n:        Developers can also use other techniques to automatically access the Open ERP database. The two
 
637
.. i18n:        Developers can also use other techniques to automatically access the OpenERP database. The two
733
638
.. i18n:        most useful are:
734
639
.. i18n: 
735
640
.. i18n:        * using the XML-RPC web service,
737
642
.. i18n:        * accessing the PostgreSQL database directly.
738
643
..
739
644
 
740
 
.. tip:: Access to the database
741
 
 
742
 
        Developers can also use other techniques to automatically access the Open ERP database. The two
743
 
        most useful are:
744
 
 
745
 
        * using the XML-RPC web service,
746
 
 
747
 
        * accessing the PostgreSQL database directly.
 
645
.. tip:: Доступ к базе данных
 
646
 
 
647
        Разработчики могут также использовать другие методы для автоматического доступа к базе данных OpenERP. Два наиболее полезных:
 
648
 
 
649
        * использование веб-сервиса XML-RPC,
 
650
 
 
651
        * прямой доступ к базе данных PostgreSQL.
748
652
 
749
653
.. i18n: .. tip:: Module Recorder
750
654
.. i18n: 
751
 
.. i18n:        If you want to enter data into Open ERP manually, you should use the Module Recorder, described in
 
655
.. i18n:        If you want to enter data into OpenERP manually, you should use the Module Recorder, described in
752
656
.. i18n:        the first section of this chapter.
753
657
.. i18n: 
754
658
.. i18n:        By doing that you'll generate a module that can easily be reused in different databases.
757
661
.. i18n:        with all of the entries and modifications you made for this system.
758
662
..
759
663
 
760
 
.. tip:: Module Recorder
761
 
 
762
 
        If you want to enter data into Open ERP manually, you should use the Module Recorder, described in
763
 
        the first section of this chapter.
764
 
 
765
 
        By doing that you'll generate a module that can easily be reused in different databases.
766
 
        Then if there are problems with a database you'll be able to reinstall the data module you
767
 
        generated
768
 
        with all of the entries and modifications you made for this system.
 
664
.. tip:: Записывающий модуль
 
665
 
 
666
        Если вы хотите вводить данные в OpenERP вручную, вам лучше использовать записывающий модуль, описанный в первом разделе данной главы.
 
667
 
 
668
        Действуя таким образом, вы создадите модуль, который можно будет легко использовать в различных базах данных. Тогда при проблемах с базой данных вы сможете заново установить модуль данных, который вы создали, со всеми внесенными в систему проводками и изменениями.
769
669
 
770
670
.. i18n: .. Copyright © Open Object Press. All rights reserved.
771
671
..