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

I want to read the one2many field values (Child table) in create method. while I am trying it returns the table object. unable to read the one2many field value through looping  

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Yognandam,

You can access the values for the one2many field after the super call of the create method.

For example, if we want to access the values of order_line(one2many) in the create method of Sale Order then we can write the super method like this:

@api.model

def create(self, vals):

    res = super(SaleOrder, self).create(vals)

    if res.order_line:

        for line in res.order_line:

              print(line)

    return res

Thanks

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Awatar
Odrzuć
Autor

It is saved as new records. I want to update the old record

Powiązane posty Odpowiedzi Widoki Czynność
1
sty 25
1697
2
wrz 22
9423
2
kwi 22
4452
0
lip 21
7143
5
sie 20
18888