コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
11425 ビュー

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
2902
0
4月 16
3217
3
3月 16
14026
1
3月 15
12439
1
4月 23
5189