~openerp-dev/openobject-doc/trunk

« back to all changes in this revision

Viewing changes to i18n/it/source/developer/4_13_server_action/index.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: Server Action
 
3
.. i18n: =============
 
4
..
 
5
 
 
6
Server Action
 
7
=============
 
8
 
 
9
.. i18n: Introduction
 
10
.. i18n: ------------
 
11
.. i18n: Server action is an new feature to the OpenERP available since the version 5.0 beta, This is the
 
12
.. i18n: interesting features for the customizer, to full fill the customers requirements, This features enables
 
13
.. i18n: to provides the quick and easy configuration some process which is day to day requirements. Like
 
14
.. i18n: send email on confirmation of the sale order, or confirmation of the Invoice, log the operation of
 
15
.. i18n: the invoice (confirm, cancel, etc..). or need to develope some system which runs wizard / report on
 
16
.. i18n: the confirmation of the sales, purchase, or invoice. So Server action is the only one answer to solve
 
17
.. i18n: all this kind of problems without doing any development, just a few configuration and the system is
 
18
.. i18n: ready to answer few of above questions.
 
19
..
 
20
 
 
21
Introduction
 
22
------------
 
23
Server action is an new feature to the OpenERP available since the version 5.0 beta, This is the
 
24
interesting features for the customizer, to full fill the customers requirements, This features enables
 
25
to provides the quick and easy configuration some process which is day to day requirements. Like
 
26
send email on confirmation of the sale order, or confirmation of the Invoice, log the operation of
 
27
the invoice (confirm, cancel, etc..). or need to develope some system which runs wizard / report on
 
28
the confirmation of the sales, purchase, or invoice. So Server action is the only one answer to solve
 
29
all this kind of problems without doing any development, just a few configuration and the system is
 
30
ready to answer few of above questions.
 
31
 
 
32
.. i18n: Following are the list of action types which are supplied under the Server Action.
 
33
..
 
34
 
 
35
Following are the list of action types which are supplied under the Server Action.
 
36
 
 
37
.. i18n:        * Client Action
 
38
.. i18n:        * Trigger
 
39
.. i18n:        * Email
 
40
.. i18n:        * SMS
 
41
.. i18n:        * Create Object
 
42
.. i18n:        * Write Object
 
43
.. i18n:        * Multi Action
 
44
..
 
45
 
 
46
       * Client Action
 
47
       * Trigger
 
48
       * Email
 
49
       * SMS
 
50
       * Create Object
 
51
       * Write Object
 
52
       * Multi Action
 
53
 
 
54
.. i18n: Each type of action have the special features and different configuration parameters. We will see
 
55
.. i18n: one by one all type of action how to configure and list of parameters that affect the system
 
56
..
 
57
 
 
58
Each type of action have the special features and different configuration parameters. We will see
 
59
one by one all type of action how to configure and list of parameters that affect the system
 
60
 
 
61
.. i18n: Client Action
 
62
.. i18n: -------------
 
63
..
 
64
 
 
65
Client Action
 
66
-------------
 
67
 
 
68
.. i18n: This action executes at client side, this is a good idea to run the wizard or report at client side.
 
69
.. i18n: Using this type of action we can make the system like ERP will print the invoice after confirmation
 
70
.. i18n: of the Invoice. Like it will run the payment wizard after confirmation of the invoice. Technically we
 
71
.. i18n: can run all client action which execute at client side. We can execute ir.actions.report.custom,
 
72
.. i18n: ir.actions.report.xml, ir.actions.act_window, ir.actions.wizard, or ir.actions.url. Here is an example
 
73
.. i18n: to show how we can configuration Client action to print the invoice after confirmation of the
 
74
.. i18n: invoice.
 
75
..
 
76
 
 
77
This action executes at client side, this is a good idea to run the wizard or report at client side.
 
78
Using this type of action we can make the system like ERP will print the invoice after confirmation
 
79
of the Invoice. Like it will run the payment wizard after confirmation of the invoice. Technically we
 
80
can run all client action which execute at client side. We can execute ir.actions.report.custom,
 
81
ir.actions.report.xml, ir.actions.act_window, ir.actions.wizard, or ir.actions.url. Here is an example
 
82
to show how we can configuration Client action to print the invoice after confirmation of the
 
83
invoice.
 
84
 
 
85
.. i18n: .. image:: images/client_action.png
 
86
..
 
87
 
 
88
.. image:: images/client_action.png
 
89
 
 
90
.. i18n: This is an good and seems easy to configure the action.
 
91
..
 
92
 
 
93
This is an good and seems easy to configure the action.
 
94
 
 
95
.. i18n: Important fields are
 
96
..
 
97
 
 
98
Important fields are
 
99
 
 
100
.. i18n: :Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
101
.. i18n: :Client Action: Select the client action that is to execute at client side. Any of the following types.
 
102
..
 
103
 
 
104
:Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
105
:Client Action: Select the client action that is to execute at client side. Any of the following types.
 
106
 
 
107
.. i18n: * ir.actions.report.custom
 
108
.. i18n: * ir.actions.report.xml
 
109
.. i18n: * ir.actions.act_window
 
110
.. i18n: * ir.actions.wizard
 
111
.. i18n: * ir.actions.url
 
112
..
 
113
 
 
114
* ir.actions.report.custom
 
115
* ir.actions.report.xml
 
116
* ir.actions.act_window
 
117
* ir.actions.wizard
 
118
* ir.actions.url
 
119
 
 
120
.. i18n: Trigger
 
121
.. i18n: -------
 
122
..
 
123
 
 
124
Trigger
 
125
-------
 
126
 
 
127
.. i18n: Trigger is an really excellent when we want to deal with the work flow of the other object which
 
128
.. i18n: working the work flow of the first object. For example we want to configure the system like when
 
129
.. i18n: we confirm the purchase order and create the invoice that newly created invoice should confirm it
 
130
.. i18n: self automatically by the server action.
 
131
..
 
132
 
 
133
Trigger is an really excellent when we want to deal with the work flow of the other object which
 
134
working the work flow of the first object. For example we want to configure the system like when
 
135
we confirm the purchase order and create the invoice that newly created invoice should confirm it
 
136
self automatically by the server action.
 
137
 
 
138
.. i18n: .. image:: images/trigger_action.png
 
139
..
 
140
 
 
141
.. image:: images/trigger_action.png
 
142
 
 
143
.. i18n: This is the easy configuration for the trigger to have the system where the created invoice will
 
144
.. i18n: confirm it self.
 
145
..
 
146
 
 
147
This is the easy configuration for the trigger to have the system where the created invoice will
 
148
confirm it self.
 
149
 
 
150
.. i18n: Important fields are
 
151
..
 
152
 
 
153
Important fields are
 
154
 
 
155
.. i18n: :Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
156
..
 
157
 
 
158
:Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
159
 
 
160
.. i18n: :Work-flow on: Here we select invoice, need to select the model on which the automatic workflow will be called by the action system
 
161
..
 
162
 
 
163
:Work-flow on: Here we select invoice, need to select the model on which the automatic workflow will be called by the action system
 
164
 
 
165
.. i18n: :Trigger On: We need to provide the id of the newly record, here in this case, Purchase order store the id of the Invoice after creating of the invoice in invoice_id field.
 
166
..
 
167
 
 
168
:Trigger On: We need to provide the id of the newly record, here in this case, Purchase order store the id of the Invoice after creating of the invoice in invoice_id field.
 
169
 
 
170
.. i18n: :Trigger Name: This is the signal name which we want to generate on the newly created object.
 
171
..
 
172
 
 
173
:Trigger Name: This is the signal name which we want to generate on the newly created object.
 
174
 
 
175
.. i18n: Email Action
 
176
.. i18n: ------------
 
177
..
 
178
 
 
179
Email Action
 
180
------------
 
181
 
 
182
.. i18n: This is the common requirement for all business process, like send the confirmation by the email
 
183
.. i18n: when sales order, purchase order, invoice, payment, shipping of goods will takes place. For that we
 
184
.. i18n: need only few things to configure and tiny will send the email very quickly and in easy way. Even
 
185
.. i18n: not need to setting up the your own email server, you can use your exciting email server and
 
186
.. i18n: account, of you not have your email server you can use from the free email account by Gmail,
 
187
.. i18n: Yahoo !, etc..
 
188
..
 
189
 
 
190
This is the common requirement for all business process, like send the confirmation by the email
 
191
when sales order, purchase order, invoice, payment, shipping of goods will takes place. For that we
 
192
need only few things to configure and tiny will send the email very quickly and in easy way. Even
 
193
not need to setting up the your own email server, you can use your exciting email server and
 
194
account, of you not have your email server you can use from the free email account by Gmail,
 
195
Yahoo !, etc..
 
196
 
 
197
.. i18n: *Server Configuration*
 
198
..
 
199
 
 
200
*Server Configuration*
 
201
 
 
202
.. i18n: supply the following parameters when we run OpenERP Server.
 
203
..
 
204
 
 
205
supply the following parameters when we run OpenERP Server.
 
206
 
 
207
.. i18n: ::
 
208
.. i18n: 
 
209
.. i18n:   --email-from=gajjarmantavya@yahoo.co.in user email address
 
210
.. i18n:   --smtp=smtp.mail.yahoo.co.in smtp server name or ip
 
211
.. i18n:   --smtp-port=587 smtp port
 
212
.. i18n:   --smtp-user=gajjarmantavya user name usually same as the email address name without domain name
 
213
.. i18n:   --smtp-password=************* password to the user account
 
214
.. i18n:   --smtp-ssl=False use in case if the server required ssl for sending email
 
215
..
 
216
 
 
217
::
 
218
 
 
219
  --email-from=gajjarmantavya@yahoo.co.in user email address
 
220
  --smtp=smtp.mail.yahoo.co.in smtp server name or ip
 
221
  --smtp-port=587 smtp port
 
222
  --smtp-user=gajjarmantavya user name usually same as the email address name without domain name
 
223
  --smtp-password=************* password to the user account
 
224
  --smtp-ssl=False use in case if the server required ssl for sending email
 
225
 
 
226
.. i18n: .. **
 
227
..
 
228
 
 
229
.. **
 
230
 
 
231
.. i18n: Email Action Configuration
 
232
..
 
233
 
 
234
Email Action Configuration
 
235
 
 
236
.. i18n: .. image:: images/email_action.png
 
237
..
 
238
 
 
239
.. image:: images/email_action.png
 
240
 
 
241
.. i18n: Important Fields are:
 
242
..
 
243
 
 
244
Important Fields are:
 
245
 
 
246
.. i18n: :Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
247
.. i18n: :Contact: We need to select the fields from which action will select the email address to whom we would like to send the email, system will display all the fields related to the current object selected in the Object field
 
248
.. i18n: :Message: You can provide the message template with the fields that relate to the current object. And it will be merged when it is going to send the email. This is the same language than the rml which is used to design the report here we can use the [[ ]] + html tags to design in the html format Working with You can select the any fields from the current object, like here we select the [[ ]] invoice in the object.
 
249
..
 
250
 
 
251
:Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
252
:Contact: We need to select the fields from which action will select the email address to whom we would like to send the email, system will display all the fields related to the current object selected in the Object field
 
253
:Message: You can provide the message template with the fields that relate to the current object. And it will be merged when it is going to send the email. This is the same language than the rml which is used to design the report here we can use the [[ ]] + html tags to design in the html format Working with You can select the any fields from the current object, like here we select the [[ ]] invoice in the object.
 
254
 
 
255
.. i18n: For example to get the partner name we can use [[ object.partner_id.name ]]like the same, object refers to the current object and we can access any fields which exist in the model.
 
256
..
 
257
 
 
258
For example to get the partner name we can use [[ object.partner_id.name ]]like the same, object refers to the current object and we can access any fields which exist in the model.
 
259
 
 
260
.. i18n: After confirmation the invoice we get the confirmation email from the action.
 
261
..
 
262
 
 
263
After confirmation the invoice we get the confirmation email from the action.
 
264
 
 
265
.. i18n: .. image:: images/email_confirm.png
 
266
..
 
267
 
 
268
.. image:: images/email_confirm.png
 
269
 
 
270
.. i18n: Create Object
 
271
.. i18n: -------------
 
272
..
 
273
 
 
274
Create Object
 
275
-------------
 
276
 
 
277
.. i18n: This is an interesting feature for the tiny partners those who want to track the transaction in the
 
278
.. i18n: OpenERP, like currently in the ERP you can get the Event history on the Partners which logs the
 
279
.. i18n: only the sales order events. But if we want to start logging the invoice like the same we can easily
 
280
.. i18n: do like that using the Create object Actions.
 
281
..
 
282
 
 
283
This is an interesting feature for the tiny partners those who want to track the transaction in the
 
284
OpenERP, like currently in the ERP you can get the Event history on the Partners which logs the
 
285
only the sales order events. But if we want to start logging the invoice like the same we can easily
 
286
do like that using the Create object Actions.
 
287
 
 
288
.. i18n: .. image:: images/create_object.png
 
289
..
 
290
 
 
291
.. image:: images/create_object.png
 
292
 
 
293
.. i18n: Create Object action have the easy but tricky configuration, for the movement you have to
 
294
.. i18n: remember the fields name or check it out from the code it self, in future we will develop the
 
295
.. i18n: expression builder inside OpenERP so you can build the complex expression.
 
296
..
 
297
 
 
298
Create Object action have the easy but tricky configuration, for the movement you have to
 
299
remember the fields name or check it out from the code it self, in future we will develop the
 
300
expression builder inside OpenERP so you can build the complex expression.
 
301
 
 
302
.. i18n: Important fields are
 
303
..
 
304
 
 
305
Important fields are
 
306
 
 
307
.. i18n: :Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
308
.. i18n: :Model: This is the target model where the new object is to be created, if its empty it refers to the current object and allow to select the fields from the same, but its advisable to provide the model in all case if different or if the same.
 
309
.. i18n: :Fields Mapping: Need to provide the 3 values
 
310
..
 
311
 
 
312
:Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
313
:Model: This is the target model where the new object is to be created, if its empty it refers to the current object and allow to select the fields from the same, but its advisable to provide the model in all case if different or if the same.
 
314
:Fields Mapping: Need to provide the 3 values
 
315
 
 
316
.. i18n: 1. Field: any of the fields from the target model
 
317
.. i18n: 2. type of the value you can give either value or expression
 
318
.. i18n: 3. provide the value or expression the expression again start with the 'object' keyword and its refers to the current object which selected in to the Object field.
 
319
..
 
320
 
 
321
1. Field: any of the fields from the target model
 
322
2. type of the value you can give either value or expression
 
323
3. provide the value or expression the expression again start with the 'object' keyword and its refers to the current object which selected in to the Object field.
 
324
 
 
325
.. i18n: *You must select the all required fields from the object*
 
326
..
 
327
 
 
328
*You must select the all required fields from the object*
 
329
 
 
330
.. i18n: :Record Id: After creating the new record where the id of the new record if going to store. So in future we can refer the same for the other operations.
 
331
..
 
332
 
 
333
:Record Id: After creating the new record where the id of the new record if going to store. So in future we can refer the same for the other operations.
 
334
 
 
335
.. i18n: Write Object
 
336
.. i18n: ------------
 
337
..
 
338
 
 
339
Write Object
 
340
------------
 
341
 
 
342
.. i18n: The same configuration as defined for the Create Object, here we take an example that it will write the
 
343
.. i18n: 'Additional Information' on the same object
 
344
..
 
345
 
 
346
The same configuration as defined for the Create Object, here we take an example that it will write the
 
347
'Additional Information' on the same object
 
348
 
 
349
.. i18n: .. image:: images/write_object.png
 
350
..
 
351
 
 
352
.. image:: images/write_object.png
 
353
 
 
354
.. i18n: Important Fields are
 
355
..
 
356
 
 
357
Important Fields are
 
358
 
 
359
.. i18n:   **same as the Create Object**
 
360
..
 
361
 
 
362
  **same as the Create Object**
 
363
 
 
364
.. i18n: Multi Action
 
365
.. i18n: ------------
 
366
..
 
367
 
 
368
Multi Action
 
369
------------
 
370
 
 
371
.. i18n: This is the most interesting action, which allows to execute the multiple server action on the same
 
372
.. i18n: business operations. Like if you want to print and send the email on confirmation of the invoice. We
 
373
.. i18n: need to create the 3 Server Actions for that.
 
374
..
 
375
 
 
376
This is the most interesting action, which allows to execute the multiple server action on the same
 
377
business operations. Like if you want to print and send the email on confirmation of the invoice. We
 
378
need to create the 3 Server Actions for that.
 
379
 
 
380
.. i18n:   * Print Invoice
 
381
.. i18n:   * Invoice Confirmation Email !!
 
382
.. i18n:   * Multi Action
 
383
..
 
384
 
 
385
  * Print Invoice
 
386
  * Invoice Confirmation Email !!
 
387
  * Multi Action
 
388
 
 
389
.. i18n: The only problem with the Multi Action is that it will execute many actions at the server side, but only
 
390
.. i18n: one client action will be executed.
 
391
..
 
392
 
 
393
The only problem with the Multi Action is that it will execute many actions at the server side, but only
 
394
one client action will be executed.
 
395
 
 
396
.. i18n: For example we would like to print report + execute the wizard this 2 operation is not allowd in the
 
397
.. i18n: one multi action.
 
398
..
 
399
 
 
400
For example we would like to print report + execute the wizard this 2 operation is not allowd in the
 
401
one multi action.
 
402
 
 
403
.. i18n: .. image:: images/multi_action.png
 
404
..
 
405
 
 
406
.. image:: images/multi_action.png
 
407
 
 
408
.. i18n: Important Fields are
 
409
..
 
410
 
 
411
Important Fields are
 
412
 
 
413
.. i18n: :Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
414
.. i18n: :Other Actions: We need to select the server action in this fields, we are free to select the as many as actions as we can. Just we need to take care for the problem of the multi action, other things is very easy.
 
415
..
 
416
 
 
417
:Object: Select the object on which we want to implement the Server Action when work flow will execute on this object
 
418
:Other Actions: We need to select the server action in this fields, we are free to select the as many as actions as we can. Just we need to take care for the problem of the multi action, other things is very easy.
 
419
 
 
420
.. i18n: **Link it up with the Work flow**
 
421
..
 
422
 
 
423
**Link it up with the Work flow**
 
424
 
 
425
.. i18n: The important things is to link the server action with the work flow, its bit easy to link with action
 
426
.. i18n: with the work flow. Open the work flow editor in GTK, select the work flow and go to the start and
 
427
.. i18n: select the Sever Action. This will automatically be called when the object comes to that state.
 
428
..
 
429
 
 
430
The important things is to link the server action with the work flow, its bit easy to link with action
 
431
with the work flow. Open the work flow editor in GTK, select the work flow and go to the start and
 
432
select the Sever Action. This will automatically be called when the object comes to that state.
 
433
 
 
434
.. i18n: .. image:: images/link_workflow.png
 
435
..
 
436
 
 
437
.. image:: images/link_workflow.png
 
438
 
 
439
.. i18n: Here in this example I added the Action to print the Invoice, when the Invoice will be confirmed.
 
440
..
 
441
 
 
442
Here in this example I added the Action to print the Invoice, when the Invoice will be confirmed.