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

Hi

I am trying to create one2many lines from onchange method.  The Parent ID should be specified to create that.

But parent is NewID.

crm.lead(<odoo.models.NewId object at 0x7faf0f2c3750>,)

What can I do ?

아바타
취소

Thanks Mohammed 

베스트 답변

Hi

have you tried using self.update?

self.update({
'attendance_line': [(0, 0, {values})],
})

 This method does not require id of current record

아바타
취소
작성자

Thanks Muhammed !!!

Your answer is perfect.

베스트 답변

You can find the full details to update the values in One2many/Many2many using the flags from here

https://hilarlive.wordpress.com/2017/04/22/one2many-or-many2many-flags/

아바타
취소
베스트 답변

Hi Mohammed!

It looks like your solution should solve my problem but i cannot understand how i should do it. Could you explain a bit more?

My problem is the following: i try to create a new sale.order.line in an sale.order which is not yet created.

Thanks in advance for your time :-)

아바타
취소

Thanks a lot for your solution Mohammed. I found how to do. It works well. Thx!

베스트 답변

Tnx Mohammed !!

아바타
취소
관련 게시물 답글 화면 활동
0
9월 20
2989
0
4월 16
3292
3
3월 16
14133
1
3월 15
12532
1
4월 23
5229