Hi,
I am new to odoo, so just would like to know step by step method to EXECUTE QUERY AND RETRIEVE RECORDS AND DISPLAY IN XML
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I am new to odoo, so just would like to know step by step method to EXECUTE QUERY AND RETRIEVE RECORDS AND DISPLAY IN XML
Thanks
Hi,
There is two ways to fetch data from the database, ir, ORM method and the Queries.
To fetch the data from db using query you can do it like this,
self.env.cr.execute("SELECT id, password FROM res_users"
" WHERE password IS NOT NULL"
" AND password != ''")
The above is just a sample one.
In the ORM method, you can fecth data like this.
search -
Workorders = self.env['mrp.workorder'].search([('production_id', 'in', ids)])
browse -
currency = self.env['res.currency'].browse(self.currency_id.id)
Thanks
Dear Niyas,
i used search and browse to fetch data but it takes 10 secs or more to display it (20 records) ,how can I fetch data faster? Do I need to used queries?
For 20 records, query and search/browse will have same speed. Also make sure that your instance is configured and optimised
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hi Niyas ,Thanks for your Answer , but how to display those records in xml, what will be the reference
Hi Niyas ,Thanks for your Answer , but how to display those records in xml, what will be the reference
How to use it in XML means ....Can you explain the process exactly ? Are you looking how to use this in template ?