Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3167 Lượt xem

I try to filter the product_id field in sale.order.line to get only products, that have the same company_id as the logged in user selected in the top right dropdown, when the multicompany feature is active.

How can I add a domain that filters that?

I tried a lot of solutions, but nothing works right.

<field name="product_id" domain="[('company_id', '=', user.company_id)]"/>

<field name="product_id" domain="[('company_id', '=', env.user.company_id)]"/>

thanks


PS: the big problem is, when a user have multiple company in the settings


EDIT: It's possible with the security rule on the "product.product" object, but then it's for every model that use product_id.

I only want it for the purchase.order.line





Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Wizardz, 



You just have to disable this option for the multi company.

Thanks...

For more information Contact us :-  https://kanakinfosystems.com/odoo-development-services

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 17
7203
5
thg 9 20
12837
1
thg 3 15
5321
2
thg 3 15
7543
0
thg 3 15
3995