Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
5879 Widoki

Hi,

I'm trying to make in OpenERP something like SELECT item1, item2 COUNT(*) FROM table WHERE conditions GROUP BY item1, item2 HAVING COUNT(*) > 5

I have in my tree view:

<field name="domain">CONDITIONS</field>
<field name="context">{'group_by': ['item1', 'item2']}</field>

I figured out that I can use read_group() function to make filtering for COUNT(*) using context['active_ids'] when this view is generated, however it is very slowly and inefficient. Cause I have to iterate through items and look for repetitions by Python.

What are possible solutions in this situations? Better would be to make this whole SELECT by using cursor manualy through wizard, or is there anything like COUNT(*) filtering in OpenERP view syntax?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 23
2685
1
sie 21
11229
1
lut 25
20827
0
mar 15
5627
0
sie 24
224