Odoo Help


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.


Why doesn't open one window (ir.action.windows) when i click one button?

James Ford
on 5/16/16, 3:49 PM 203 views

Hello friends. My situation is as follows:
I have my form sale.order model.  And what I want is that when you press 'Confirm sale' , it must open the inventory form ( stock.picking.form ) . An easy way is modifying sensitive button 'Confirm sale' and add the function that opens the inventory form . The function that opens the inventory form is called action_view_delivery (). This in the sale.order model. And the function of the button 'Confirm sale' is called action_confirm (). And also this in the sale.order model.

This is the imagine that shows the sale.order form before to confirm sale.


This is what should display when i press the 'Confirm sale' button .


And this is the function of the button 'Confirm sale'


def action_confirm(self):

for order in self:

order.state = 'sale'

if self.env.context.get('send_email'):



if not order.project_id:

for line in order.order_line:

if line.product_id.invoice_policy == 'cost':



if self.env['ir.values'].get_default('sale.config.settings', 'auto_done_setting'):


self.action_view_delivery()  // I added this line to call the funcion that opens the stock picking form.

return True

Why not automatically open the inventory form when i press the custom button?


Prakash Sharma

--Prakash Sharma--
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 5/17/16, 1:36 AM

instead on return True ,use return self.action_view_delivery() 

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)


Asked: 5/16/16, 3:49 PM
Seen: 203 times
Last updated: 5/17/16, 1:36 AM