Skip to Content
Menu
This question has been flagged
1 Reply
2900 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.

http://es.zimagez.com/zimage/confirmsale.php


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

http://es.zimagez.com/zimage/stockpickingform.php


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

@api.multi

def action_confirm(self):

for order in self:

order.state = 'sale'

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

self.force_quotation_send()

order.order_line._action_procurement_create()

if not order.project_id:

for line in order.order_line:

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

order._create_analytic_account()

break

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

self.action_done()

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?

Avatar
Discard
Best Answer

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

Avatar
Discard