Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
11431 Widoki

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 ?

Awatar
Odrzuć

Thanks Mohammed 

Najlepsza odpowiedź

Hi

have you tried using self.update?

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

 This method does not require id of current record

Awatar
Odrzuć
Autor

Thanks Muhammed !!!

Your answer is perfect.

Najlepsza odpowiedź

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/

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć

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

Najlepsza odpowiedź

Tnx Mohammed !!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 20
2906
0
kwi 16
3219
3
mar 16
14028
1
mar 15
12442
1
kwi 23
5189