Skip to Content
Menu
This question has been flagged

Hello All,

I want to return Sales Orders view from Quotation screen by clicking button. This button visible when order confirmed. i want that after clicking this button screen moves in "Sales Orders" Menu. So, Please provide any solution for this problem. 

Thanks in advance,

My Python code is here:

@api.multi
def test_button(self):
ir_model_data = self.env['ir.model.data']
try:
view_id = ir_model_data.get_object_reference('sale', 'view_order_form')[1]
except ValueError:
view_id = False
record_id = self.env['sale.order'].search([('id', '=', self.id)])
print "RECORD", view_id, record_id
return {
'name': record_id.name,
'view_type': 'form',
'view_mode': 'form',
'views': [(view_id, 'form')],
'res_model': 'sale.order',
'view_id': view_id,
'type': 'ir.actions.act_window',
'res_id': record_id.id,
        'target': 'fullscreen'}
Avatar
Discard

your code is correct, any logs preventing the trigger

Author

No, And i want that this form should show "Sales Orders" string on Top left side.

Related Posts Replies Views Activity
0
Oct 22
1308
0
Oct 22
1074
0
Aug 22
897
1
Jul 22
17732
0
Apr 22
1613