How to get dictionary from product?
models_ids = self.env['product.template'].search([('id', '=', rule.product_id.id)])
my_dict = dict(models_ids)
example:
my_dict = {'id': 3, 'type': consu, 'categ_id': 1 ...e.t.c}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to get dictionary from product?
models_ids = self.env['product.template'].search([('id', '=', rule.product_id.id)])
my_dict = dict(models_ids)
example:
my_dict = {'id': 3, 'type': consu, 'categ_id': 1 ...e.t.c}
Hope this helps you
prod_obj = self.env['product.template']
models_ids = self.env['product.template'].search([('id', '=', rule.product_id.id)])
for model in models_ids:
new_dict = model.read(list(set(prod_obj._fields)))
print(new_dict)
Hi,
You can try like following method.
models_ids = self.env['product.template'].search_read(
[('id', '=', rule.product_id.id)])
Regards
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
3
jul. 19
|
14086 | ||
|
0
mrt. 21
|
24 | ||
Dict only manual fields
Opgelost
|
|
2
jul. 19
|
4293 | |
|
0
jan. 21
|
3252 | ||
|
1
feb. 25
|
390 |