Hello,
In a module that I've created (class miadi_packaging), I want to do take the name of a product which is in the product.product table.
I'm trying two ways but I've an error with the both.
First I tried this :
produits = self._cr.execute("SELECT * FROM product_product")
for produits in self.env.cr.fetchall():
nom_produit = produits['display_name']
#Doing something with the nom_produit
But it tell me that tuple indices must be integers, not str and if I write "SELECT display_name FROM product_product", it tell me that the display_name column doesn't exist.
In the second way, I tried to do this :
productVariants = self.env['product.product']
products = productVariants.search([])
and it gives me something like this : product_product(7, 18, 25, 36, 38, 39, 75...)
How can I take the name of ONE product at a time with this result ?
Thanks for help