콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3669 화면

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.

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
1월 21
3258
2
5월 23
6002
0
5월 15
5504
1
6월 25
5111
1
5월 24
3188