Commit 29104699 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_accounting: keep select_list if propagated in params

We propagate select_list from gadgets graph js and we need to count() instead of other parameters introduced in select_dict
parent e31ea975
...@@ -91,20 +91,25 @@ if creation_date_range_min or creation_date_range_max: ...@@ -91,20 +91,25 @@ if creation_date_range_min or creation_date_range_max:
query=(creation_date_range_max, ), query=(creation_date_range_max, ),
range='max') range='max')
select_dict = params.get('select_dict') or {} # GRAPH JS: We propagate select_list from gadgets graph js.
select_dict['total_debit'] = None # GRAPH JS: If select_list is propagated in params, we should keep it,
select_dict['total_credit'] = None # GRAPH JS: we use count() and the parameters below breaks the graphs.
# XXX: force mapping of reference column to catalog, to take advantage of (portal_type, reference) index. if "select_list" not in params:
# Without this, ColumnMapper would choose to use accounting_transaction.reference, because a lot of select_dict = params.get('select_dict') or {}
# columns from that table are used. But it does not realise there is no portal_type column *and* select_dict['total_debit'] = None
# a (portal_type, reference) index exists on catalog. select_dict['total_credit'] = None
select_dict['reference'] = 'catalog.reference' # XXX: force mapping of reference column to catalog, to take advantage of (portal_type, reference) index.
select_dict['specific_reference'] = None # Without this, ColumnMapper would choose to use accounting_transaction.reference, because a lot of
select_dict['project_uid'] = None # columns from that table are used. But it does not realise there is no portal_type column *and*
select_dict['payment_uid'] = None # a (portal_type, reference) index exists on catalog.
select_dict['mirror_section_uid'] = None #select_dict['reference'] = 'catalog.reference'
select_dict['operation_date'] = None select_dict['specific_reference'] = None
params['select_dict'] = select_dict select_dict['project_uid'] = None
select_dict['payment_uid'] = None
select_dict['mirror_section_uid'] = None
select_dict['operation_date'] = None
params['select_dict'] = select_dict
# We group by uid to really filter duplicated lines, but this makes generated # We group by uid to really filter duplicated lines, but this makes generated
# query much slower, and in reality duplicated lines are transactions for which # query much slower, and in reality duplicated lines are transactions for which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment