Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4741 Представления

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  

Аватар
Отменить
Лучший ответ

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

   

Аватар
Отменить
Автор

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

Related Posts Ответы Просмотры Активность
1
янв. 25
1586
2
сент. 22
9339
2
апр. 22
4360
0
июл. 21
7017
5
авг. 20
18728