What is the best way to get distinct order ids from the order lines?
Asked by
Numérigraphe
Often in the addons we see functions like this:
def _get_order(self, cr, uid, ids, context={}):
result = {}
for line in self.pool.
return result.keys()
That reads the order ids of all the selected lines from the database, and uses a dictionary to make the values distinct.
First, can't we just read() and use a set to make values distinct?
Second, is there not a way to just do a "SELECT DISTINCT" on the database and not have to loop?
Lionel
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by Numérigraphe
Can you help with this problem?
Provide an answer of your own, or ask Numérigraphe for more information if necessary.
To post a message you must log in.