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

I have two fields in model res.contract "society_id" and "phase_id" inherited from "file" model. And in "file" model these two fields are related. I think that is why it is not saving these fields in my current model. I have used force_save = "1" attribute but still no luck. Any help?

아바타
취소
베스트 답변

In the file model, you are not saving the related fields into the database. In the file model write like this:

phase_id = fields.Many2one(comodel_name='your.model', string='Your String',
related='model_field.phase_id', store='True')
society_id = fields.Many2one(comodel_name='your.model', string='Your String',
related='model_field.society_id', store='True')

Now you should get the value.

아바타
취소
베스트 답변

for me in odoo11 i have to use store=True in py and force_save="1" in xml

아바타
취소
관련 게시물 답글 화면 활동
5
4월 25
15974
2
11월 18
2643
0
11월 18
2552
1
11월 18
5790
5
2월 18
4878