Odoo Help

Welcome!

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.

0

How to open form view of specific partner_id to particular user_id Using controller

By
Sah Vinay Mahabir
on 11/30/16, 9:43 AM 56 views

I have a controller in odoo 10 like this

@http.route('/open_res_partner_form_view', auth= "public", csrf= False, type= "http") 
def open_res_partner_form_view(self, **kwargs):
     user_id= 1 #in odoo user_id 1 is for administrator
     return {
              'name': _('res_partner_form'),
              'type': 'ir.actions.act_window',
              'res_model': 'res.partner',
              'views': [(self.env.ref('base.view_partner_form').id, 'form')],
              'res_id': 18,  #assume 18 is some partner_id in odoo
            }
i want to achive this action, whenever this controller is called, it should populate res.partner form of partner id 18(some existing partner_id) to user_id 1 (to administrator)
Is there any way to achieve this?

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)

Stats

Asked: 11/30/16, 9:43 AM
Seen: 56 times
Last updated: 11/30/16, 10:06 AM