跳至内容
菜单
此问题已终结
1 回复
4800 查看

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

相关帖文 回复 查看 活动
1
1月 25
1637
2
9月 22
9396
2
4月 22
4415
0
7月 21
7101
5
8月 20
18818