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

Hello,

How to pass values and create the record for all field names of model_a.py which is according to the selection field name line (via "Add a line" link) in one2many tree view in the form view of model_b.py via the wizard button?


Please help!

Thank you!

아바타
취소
베스트 답변

hello  leon, 

please find code in Comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

아바타
취소

Try this,
*suppose line_ids is One2many fields in wizard
*order_line is One2many fields in model_b

def create_line(self):
vals = []
for line in self.line_ids
vals.append(
(0, 0, {'field_1': line.field_1.id, 'field_2': line.field_2})
)
model_b = self.env['model_b'].create({
'order_line': vals
})

관련 게시물 답글 화면 활동
1
5월 20
3349
0
2월 21
3749
0
1월 21
3020
1
2월 24
1468
0
12월 21
2768