Type name = "action" in openerp button
I have a problem when I want to make a button in type="action"
, it is really different from type="object"
. I just want to make a button that can connect one module to another. It already exists in openerp for several buttons type="action"
. I just want to understand what is the function of "name"
this button?
I have an example, I found this xml script in the backend selling folder:
<button name="%(action_view_sale_advance_payment_inv)d"
string="Create Invoice"
type="action"
states="manual"
class="oe_highlight"
groups="base.group_user"/>
when i installed the sale module i see the xml script in the frontend sale.order.form
, it already changes to:
<button name="278"
string="Create Invoice"
type="action"
states="manual"
class="oe_highlight"
groups="base.group_user"/>
What's going on with "name"
? Can anyone give me a simple button type="action"
?
source to share
There are three types of types for a button: object , action, and workflow . default workflow .
Now let's understand the meaning of these three types:
-
object
used when you want to call a method that is written in a file.py
. -
action
used when you want to invoke any action written in the file.xml
. Let's say if you want to open a wizard from a button click, you can usetype="action"
. -
workflow
(default) is used if you want to invoke a workflow .
<button name="%(action_view_sale_advance_payment_inv)d"
string="Create Invoice"
type="action">
when the Create Account button is clicked , you will see the wizard.
<button name="278" string="Create Invoice" type="action">
Here 278
is the ID in the postgresql database of the activity action_view_sale_advance_payment_inv
.
source to share