[Email protected] produced
@jeffery-Memorization
Principle
Ations
OE defines the ir.actions.actions and derives many subclasses from it.
- Ir.actions.client
- ir.actions. Act_url
- Ir.actions.act_window
- Ir.actions.act_window_close
- Ir.actions.wizard
- Ir.actions.server
Used to perform related actions.
??
Server Action
there is a subclass Ir.actions.server that can be used to perform server-side actions.
The actions that can be performed are;
' State ': fields.selection ([
(' client_action ', ' Client action '),
(' Dummy ', ' dummy '),
(' Loop ', ' iteration '),
(' Code ', ' Python code '),
(' Trigger ', ' trigger '),
(' email ', ' email '),
(' SMS ', ' SMS '),
(' object_create ', ' Create object '),
(' object_copy ', ' Copy object '),
(' Object_write ', ' Write object '),
(' Other ', ' Multi Actions '),
], ' action type ', Required=true, size=32, help= "type of the Action" is executed "),
??
??
Can be used to do all kinds of things
??
Automated Action Rules
The module defines the automatic action rules
- for what object
- conditions
- Action , that is, the action defined by Server_action
??
When to trigger
- Timer Trigger
- injected into the Create/write method of the object
??
Usage Scenarios
For example
- When a task is assigned, send a notification message to the assigned person
- Timed reminders
- When you receive a message, create an instance of the object
??
Actual operation
Establish server_actions.
Menu Settings/technical/actions/server Actions
??
Create a new action
Object selects Task, i.e. project.task
Action type Select Email
There are a number of action options available , as follows
??
Customizing message Content
- Mail Recipient
- Main message
- Message content
??
tip, if you do not know the properties of the object, you can click on the Pop-up window button to popup the Task Definition window
??
??
After setting the relevant parameters, save
So far , the server_action is set up.
??
set automatic action rule so that the action can be triggered.
Menu settings/technical/automated actions/automated Actions
??
Create a automatic action rule.
Enter rule name
Select the appropriate object, where you select the task , which is project.task
??
Set conditions
Purpose to filter which objects can perform server actions
Description
If the timer is not set, the server action is triggered when Crete/update object, otherwise it is triggered by the time set by the timer, but the corresponding object instance is filtered according to the parameters set by the trigger date.
??
??
set up actions
Click ADD button, select the server action you have created in the popup window, or create a new server action.
??
Prompted
multiple actions can be added, and actions are performed in sequence order
??
??
Note
Change. The change is the fields of the object.
Add followers, refers to assigning subscribers to this instance of object (but with conditions, see the code specifically ;))
??
Scheduled Tasks
Automatic action rules are performed periodically by Ir.cron, such as
??
??
Additional Instructions
??
??
Code injected into the object creation, modification method
??
Modify The Create method
??
Modify The Write method
??
when you perform an action, modify fields to change and the associated code for add follower
??
??
??
Summary
??
- If you use filter. Do not assign Res.user to filter !!! Otherwise, there will be permissions problems occur!!!
??
- If a timer is set. Does not inject into the model, does not trigger the action
??
??
??
- If a timer is set. and No action is triggered when the time condition is immature
??
OpenERP server action, one of the most powerful features, no