Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
11421 Visualizzazioni

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
Abbandona

Thanks Mohammed 

Risposta migliore

Hi

have you tried using self.update?

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

 This method does not require id of current record

Avatar
Abbandona
Autore

Thanks Muhammed !!!

Your answer is perfect.

Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona

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

Risposta migliore

Tnx Mohammed !!

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 20
2901
0
apr 16
3217
3
mar 16
14026
1
mar 15
12439
1
apr 23
5188