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

Hello,


I need to search for odoo in multi-company mode. I want the contacts created to be visible only to the company of the user who created them.


The user has a default company, the default company must be set in the company field (compagny.id) in the contact file.


I currently do this manually, how can I do it automatically?

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

You can use an Automated Action:

Python Code:

record['company_id'] = env.company

You might want to only apply this to customers by using Domain:

The effect of adding domain should be that if you create a customer from the “Customers” menu in the sales app then the company will be set. If you create contacts elsewhere it will not be set.

Use automated action to set company on contacts

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

Hello Clement, 

This kind of similar question has already been asked in the odoo forum.

Kindly review this one for ref. : https://www.odoo.com/forum/help-1/how-to-get-current-company-id-odoo-15-202859 

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 24
1793
0
thg 4 24
2026
3
thg 4 24
6870
Assign groups Đã xử lý
1
thg 1 25
6830
0
thg 3 24
2349