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

Hello Every one...

How to pass value of many2one field in multiple one2many lines in odoo 9. i.e when i select many2one field that value should pass in multiple one2many lines. Please let me know.

Thanks in advance.....

아바타
취소

you do not need to pass the values, all values of current object resides in self.

You should update your question with your attempts with code, else question should be closed.

작성자

Thanks now it's resolved

베스트 답변

the value will be available inside "self"

you may define your onchange function using the new api as follow


@api.onchange('your_many_to_one_field')

def onchange_your_many_to_one_field(self):

   # if you want to access the many2one it will be inside self

    your_many2one_value=self.your_many_to_one_field

   #you can pass the value to one2many field by using write function

    self.your_one2many_field.write({'column_to_be_affected':your_many2one_value})



Regards,

Husam Mustafa

아바타
취소
관련 게시물 답글 화면 활동
2
7월 22
12074
0
2월 16
4404
3
10월 22
21572
0
2월 21
3898
0
7월 16
4037