Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to know the method of a button?

By
Roberto Barreiro
on 11/25/14, 1:34 PM 931 views

I need to know wich method is called from the button "Create Invoice" of the object stock_picking. I turned on the developer mode, and doing mouse over the button I can see the next information about the button:

Object: stock.picking
Modifiers: {"invisible":["|",["state",@<|","done"],
["invoice_state","<>","2binvoiced"]]}
Button Type action
Action ID: 464

I guess the code of this button is declarated at the stock.picking object, but, How can I now wich method is called by this button? Thanks.

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 11/26/14, 3:09 AM

In this case, it is an action button, and action ID is actualy id of action in database.
In order to find out wich action is triggered by a button you need to take a look at stock_view.xml in stock module.. 
Find a button (reconginze it by string) and take a look at what action is it calling 
You can find some examples arround line 755-756 .. code definig that button could look something like:
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice/Refund"  attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}"  type="action" class="oe_highlight" groups="base.group_user"/>

"%(action_stock_invoice_onshipping)d"  is part you are looking for...

 

Now you know wich action is triggered.. so you need to search for action_stock_invoice_onshipping in redocrd ids and you will know what you wanted to find out.. 

Hope it helps.. 
 

Thanks for your answers, it helps to me.

Roberto Barreiro
on 11/26/14, 7:52 AM
0
Yassine TEIMI
On 11/25/14, 1:48 PM

It's an action button, it displays a window for example, or return some view you can know the method of a button when it's an object button.

Thanks for your answer, I didn't knew the difference between objetcs and actions. Helpfull answer ;)

Roberto Barreiro
on 11/26/14, 7:54 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/25/14, 1:34 PM
Seen: 931 times
Last updated: 3/16/15, 8:10 AM