Help

0

How to create one2many values from onchange ?

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 ?

1 Comment
Avatar
Discard
Avatar
Ioannis pap
-

Thanks Mohammed 

3 Answers
5
Avatar
Mohammed Amal N
Best Answer

Hi

have you tried using self.update?

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

 This method does not require id of current record

1 Comment
Avatar
Discard

Thanks Muhammed !!!

Your answer is perfect.

0
Avatar
Luigi Tortelloni
Best Answer

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

1 Comment
Avatar
Discard
Avatar
Luigi Tortelloni
-

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

0
Avatar
Matija
Best Answer

Tnx Mohammed !!

Avatar
Discard