Here i want to know how to get the first record of a table.
here is my code, please correct it....
user_ids = self.pool.get('test.project').browse(cr, uid, ids, context=context)
Thanks in advance...
I suggest you use this, the safe construction:
test_obj = self.pool.get('test.project')
user_ids = test_obj.search(cr, uid, [('id','in',ids)], context=context)
first_record = test_obj.browse(cr, uid, user_ids, context=context)
first_ID = user_ids
UPDATE: Full user_ids list from test.project:
user_ids = test_obj.search(cr, uid, , context=context)
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/10/15, 6:26 AM|
|Seen: 1275 times|
|Last updated: 3/16/15, 8:10 AM|