This question has been flagged
3 Replies
5201 Views

Hello All,

I am entering data in Quotation screen and i want that when i confirm sale for this Quotation than screen should be move to Sales Order menu. Firstly i got the action id for both action(Quotation and Sales order). But i facing problem that how to pass this action id in action_confirm method? Is there any solution for this type problem?

Thanks in advance

Avatar
Discard
Best Answer

Hi Pawan,

For this you just have to override `action_confirm` method and then return action of the sales order as follow:

@api.multi
def action_confirm(self):
    super(SaleOrder, self).action_cofirm()
    action = self.env.ref('sale.action_orders').read()[0]
    action['res_id'] = self.ids[0]
action['name'] = 'Sales Order'
    return action

Hope this will help you.

Sudhir Arya
Odoo ERP Functional & Technical Training, Support, Development, Customization, Migration, Implementation
ERP Harbor Consulting Services
Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Avatar
Discard
Author

Hello Sudhir,

I'm using your code and it work error free, but still string not changed form Quotation to Sales Order.

action['name'] = 'Sales Order'

Add this line in the code

Author

Still String not changed.

Thanks

Author

Hello @Sudhir,

I got Sales Order action and it's id on terminal print, But this is not returned after sale confirm. So, Can you see my code? And show me what mistake i have done.

My code is here:

@api.multi

def action_confirm(self):

if self.partner_id.pet_names:

for record in self.partner_id.pet_names:

if record == self.pet_names_info:

for s in self.order_line:

if s.product_id and self.ser9:

self.confirm_farewell_room()

break

res = super(sale_order_pet, self).action_confirm()

action = self.env.ref('sale.action_orders').read()[0]

action['res_id'] = self.ids[0]

action['name'] = 'Sales Order'

return action

Author

Hello Sudhir, It's now working for me. It's work when i created another module and update above function. Thanks