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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
1
janv. 25
|
1628 | ||
|
2
sept. 22
|
9389 | ||
|
2
avr. 22
|
4406 | ||
|
0
juil. 21
|
7088 | ||
|
5
août 20
|
18802 |