* The user clicks on the icon 'print' or 'action'.
Opening of the menu
+++++++++++++++++++
When the user open the option of the menu "Operations > Partners > Partners Contact", the next steps are done to give the user information on the action to undertake.
1. Search the action in the IR.
2. Execution of the action
1. If the action is the type Opening the Window; it indicates to the user that a new window must be opened for a selected object and it gives you the view (form or list) and the filed to use (only the pro-forma invoice).
2. The user asks the object and receives information necessary to trace a form; the fields description and the XML view.
User connection
+++++++++++++++
When a new user is connected to the server, the client must search the action to use for the first screen of this user. Generally, this action is: open the menu in the 'Operations' section.
The steps are:
1. Reading of a user file to obtain ACTION_ID
2. Reading of the action and execution of this one
The fields
++++++++++
**Action Name**
The action name
**Action Type**
Always 'ir.actions.act_window'
**View Ref**
The view used for showing the object
**Model**
The model of the object to post
**Type of View**
The type of view (Tree/Form)
**Domain Value**
The domain that decreases the visible data with this view
The view
--------
The view describes how the edition form or the data tree/list appear on screen. The views can be of 'Form' or 'Tree' type, according to whether they represent a form for the edition or a list/tree for global data viewing.
A form can be called by an action opening in 'Tree' mode. The form view is generally opened from the list mode (like if the user pushes on 'switch view').
This parameter allows you to regulate which resources are visible in a selected view.(restriction)
For example, in the invoice case, you can define an action that opens a view that shows only invoices not paid.
The domains are written in python; list of tuples. The tuples have three elements;
* the field on which the test must be done
* the operator used for the test (<, >, =, like)
* the tested value
For example, if you want to obtain only 'Draft' invoice, use the following domain; [('state','=','draft')]
In the case of a simple view, the domain define the resources which are the roots of the tree. The other resources, even if they are not from a part of the domain will be posted if the user develop the branches of the tree.
Window Action
-------------
Actions are explained in more detail in section "Administration Modules - Actions". Here's the template of an action XML record :
***id** is the identifier of the action in the table "ir.actions.act_window". It must be unique.
***name** is the name of the action (mandatory).
***view_id** is the name of the view to display when the action is activated. If this field is not defined, the view of a kind (list or form) associated to the object res_model with the highest priority field is used (if two views have the same priority, the first defined view of a kind is used).
***domain** is a list of constraints used to refine the results of a selection, and hence to get less records displayed in the view. Constraints of the list are linked together with an AND clause : a record of the table will be displayed in the view only if all the constraints are satisfied.
***context** is the context dictionary which will be visible in the view that will be opened when the action is activated. Context dictionaries are declared with the same syntax as Python dictionaries in the XML file. For more information about context dictionaries, see section " The context Dictionary".
***res_model** is the name of the object on which the action operates.
***view_type** is set to form when the action must open a new form view, and is set to tree when the action must open a new tree view.
***view_mode** is only considered if view_type is form, and ignored otherwise. The four possibilities are :
-**form,tree** : the view is first displayed as a form, the list view can be displayed by clicking the "alternate view button" ;
-**tree,form** : the view is first displayed as a list, the form view can be displayed by clicking the "alternate view button" ;
-**form** : the view is displayed as a form and there is no way to switch to list view ;
-**tree** : the view is displayed as a list and there is no way to switch to form view.
(version 5 introduced **graph** and **calendar** views)
***usage** is used [+ ***TODO*** +]
***target** the view will open in new window like wizard.
***context** will be passed to the action itself and added to its global context
A report is declared using a **report tag** inside a "data" block. The different arguments of a report tag are :
***id** : an identifier which must be unique.
***string** : the text of the menu that calls the report (if any, see below).
***model** : the OpenERP object on which the report will be rendered.
***rml** : the .RML report model. Important Note : Path is relative to addons/ directory.
***menu** : whether the report will be able to be called directly via the client or not. Setting menu to False is useful in case of reports called by wizards.
***auto** : determines if the .RML file must be parsed using the default parser or not. Using a custom parser allows you to define additional functions to your report.
If you double click on a journal/period (object: account.journal.period), this will open the selected wizard. (id="action_move_journal_line_form_select").
You can use a res_id field to allow this action only if the user click on a specific object.