Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Is it possible to print the result of an SQL queries?
For exemple my SQL queries will send me the name of 10 products. I would like to have a tree with a line for each result.
Is it possible? If yes how? With a field type function? How can I put in my field the names of the 10 products? How can I print it?
Thanks a lot
Hi Pinakin, Vitap, Gopakumar,
Thank you for your comments.
For the moment I succeed in storing the result of my SQL queries in a field type text.
cr.execute('SELECT name from product_bat where name is not null') res = cr.fetchall() result['product_BAT'] = res 'product_BAT': fields.text('product.bat'), <field name="product_BAT"/>
The problem is that I have the list of my result in one line, seperate by some coma.
Is it possible to store my result not in field.text but in a field that will print a tree with one line per result?
To Vitap Ramdevputra : For the moment I try to write directly in a common module but yes, in the futur I will create my own module.
To Gopakumar N G : Is with this kind of fields (one2many, many2many) that I will have a tree? I try to modify the fields in one2many but I don't succeed to store the result of my SQL Queries in this kind of type
To Pinakin Nayi : I will try to see how it works and I will get in touch.
Edit: I still have this problem and I am little deseperate so..if someone have an idea it will be a really good help.
Thank you again a lot
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/7/14, 8:04 PM|
|Seen: 3190 times|
|Last updated: 3/16/15, 8:10 AM|