Odoo Help


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

James Ford
on 5/16/16, 3:49 PM 518 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--
--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() 

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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