Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4771 มุมมอง

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
1599
2
ก.ย. 22
9368
2
เม.ย. 22
4379
0
ก.ค. 21
7047
5
ส.ค. 20
18780