Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
4 Antworten
11497 Ansichten

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 ?

Avatar
Verwerfen

Thanks Mohammed 

Beste Antwort

Hi

have you tried using self.update?

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

 This method does not require id of current record

Avatar
Verwerfen
Autor

Thanks Muhammed !!!

Your answer is perfect.

Beste Antwort

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/

Avatar
Verwerfen
Beste Antwort

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 :-)

Avatar
Verwerfen

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

Beste Antwort

Tnx Mohammed !!

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Sept. 20
2997
0
Apr. 16
3299
3
März 16
14154
1
März 15
12550
1
Apr. 23
5240