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
Dette spørgsmål er blevet anmeldt
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
Kan du lide at diskutere? Læs ikke bare med, deltag aktivt i debatten!
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
|
1
jan. 25
|
4514 | ||
|
|
2
sep. 22
|
11776 | ||
|
|
2
apr. 22
|
6777 | ||
|
|
0
jul. 21
|
9615 | ||
|
|
5
aug. 20
|
21912 |