I would like to know if I can add and also take a value from a field and save it in another field of another model.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hi,
You can simply use ORMs along with dot(.) operator to access the field values of any model in odoo.
Assuming the model ‘real.estate’ has the field ‘estate_name’, you can use
self.env[‘real.estate’].search([]).estate_name
If you need to give conditions for search, they can be given as parameters of search(). Also you can use other ORMs like mapped(), search_read(), browse(), etc according to the usage to take the value of the fields in a amodel.
If you need to add values to it, just equate it to the desired values. Or ORMs write(), update() can also be used. For eg,
self.env[‘ real.estate’].search([(conditions)]).estate_name = value
And in the same way, these values can be saved to another model’s field by the same way using = operator/ write()/ update..
For a detailed information about Odoo ORM, refer
https://www.cybrosys.com/blog/orm-methods-in-odoo-15
Regards
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ม.ค. 21
|
3258 | ||
|
2
พ.ค. 23
|
6002 | ||
|
0
พ.ค. 15
|
5506 | ||
How to find the field type?
แก้ไขแล้ว
|
|
1
มิ.ย. 25
|
5112 | |
|
1
พ.ค. 24
|
3189 |