I would like to create a new field inside Contact model that would hold information about Allowed companies of the related user. Now Contact model have only field “company_id” that holds currently picked company of the related user and that is not enough for me.
I tried adding new field from Odoo developer interface like this:
https://i.imgur.com/e77znzH.png
but I have no idea how to populate this field with values from another model.
I was trying to do something similar to the field “company_id” inside Contacts but there is nothing that would lead me to the answer, it just works like magic and I suspect that the logic of assigning value to this field is hard coded inside python source code.
And almost none of premade fields use Advanced properties like Related field, Dependencies or Compute. Why? Does this properties have any purpose? I couldn’t find any use for them or detailed explanation. Can this field replace python code? I don’t get this.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
See this video, this can give you some more ideas about adding the compute field from the front end: Odoo V12 - Calculated Field (commissions)
The above video demonstration is with Odoo EE and using the studio app, but for adding the compute field its same.
Thanks
But this video shows adding computed field based on value from the same model and it is not even many2many field.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 7 19
|
2525 | ||
|
3
thg 9 20
|
2502 | ||
|
3
thg 12 19
|
2568 | ||
|
1
thg 11 19
|
4142 | ||
|
2
thg 1 19
|
3114 |