Odoo Help


In purchase requisitions, select only the products of a company

Chris Torres
on 6/30/16, 1:01 PM 206 views

I am using multi-company , when I want to make a purchase is absolutely show all products of all companies, wish that products that have been set in each company are displayed.

Estoy utilizando multicompanias, cuando quiero realizar una compra se muestran absolutamente todos los productos de todas las companias, deseo que se muestren los productos que han sido configurados en cada compania.

Chris Torres
On 7/1/16, 11:08 AM

Thanks, I overwrote the search method , and it works

user_company_id = self.env['res.users'].search([('id', '=', self._uid)], limit=1).company_idcompany_id = self._context.get('company_id') or user_company_id.idargs += [('company_id', '=', company_id)]return super(product_product, self).search(args)
Dilip Dabhi
On 7/1/16, 1:18 AM

It's simple,

In product you should have set company, and in that have company_id field.

And in purchase order also have company_id field,

You just have to inherit form view of purchase order and set domain in purchase order line for product_id field, domain is below.

domain = "[('company_id','=',parent.company_id)]"

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 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: 6/30/16, 1:01 PM
Seen: 206 times
Last updated: 7/1/16, 11:08 AM