MAKING POP-UP FORM, TRIGERED BY BUTTON
(Action Act Window"ir.actions.act.window")
Prepare The Form
We create the form first and put it on the action record and menu item.Why? because the form id is called the first time.The form id is called by the action and the action id will be called by the button.If it is not sequential, an error will occur because the id that was called has not been defined. Here we create wizard form, you can use other common form.
This is the example view form :
Prepare The Action Act Window
<record model="ir.actions.act_window" id="[ID_THIS_ACTION]">
The most common action type, used to present visualisations of a model through views: a window action defines a set of view types (and possibly specific views) for a model (and possibly specific record of the model). search_view_id, target, domain, context are optional in action. This example action that you can follow:
Making The Button
Make the simple button that call the action is just need name action that call the action id and the action type is 'action' and don't forget string to your button. Example:
<button name="%(module_name.action_id)d" states="your_state" string="Button_String" type="action" />
You can put the button where you want. If you want the button in the header of the form view (like most submit, send e-mail, share, etc) you simply wrap it within a <header> tag. If you want it somewhere else in the form then don't add the <header> around it. Example:
You can also add attributes like groups, attrs, states, etc. This is the Example
name ==> call action that you want, don't forget to use "%( )d"
states ==> This button will be visible when the state value is 'submit'
string ==> This string will be appear in the button
groups ==> This button will be visible if the user has the groups 'my_own_groups
type ==> There is two kind of type (object & action) Object can call function in python and action can call action in xml