Odoo version 11.0
Currently, i got product by filter like,
lafilter[0] = new object[3] { "type", "=", "product" };
- and also i want to add one more filter for get unique record, like "distinct by Id"
any idea about "distinct" record ?
Thanks 
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
Odoo version 11.0
Currently, i got product by filter like,
lafilter[0] = new object[3] { "type", "=", "product" };
- and also i want to add one more filter for get unique record, like "distinct by Id"
any idea about "distinct" record ?
Thanks 
Hi,
You can group by that field by calling read_group function, for example:
result = self.env['yourmodel'].read_group([ ("type", "=", "product") ], fields=['Id'], groupby=['Id'])
PS: if you liked the answer - please upvote it :)
Awesome!!!
if you are working in JavaScript here is the rpc query
                    rpc.query({
                        model: 'sale.report',
                        method: 'read_group',
                        fields: ['price_subtotal:sum'],
                        kwargs: {groupby: 'date:year'},
                        lazy: false,
                    }).then(function (result) {
                        console.log(result)
                    });
Hello
I used read_group like this.
But without orderby=False then 'ORDER BY "id" is ambiguous' or
with orderby=['id'] then 'TypeError: expected string or bytes-like object'
How can I use it?
I changed with orderby='name' is working
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|  | 1 jan. 19  | 5974 | ||
|  | 0 nov. 18  | 4706 | ||
|  | 1 nov. 22  | 4030 | ||
| 
            
                Live tracking in odoo.
            
            
                    Opgelost
            
         |  | 2 aug. 22  | 8446 | |
|  | 1 jan. 25  | 10330 |