Skip to content

Commit

Permalink
Acq accounts: default sort on name field
Browse files Browse the repository at this point in the history
Closes rero#1781.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Apr 29, 2021
1 parent ebfdee3 commit d0f412c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,7 @@ def _(x):

# sort options
indexes = [
'acq_accounts',
'budgets',
'circ_policies',
'collections',
Expand Down Expand Up @@ -2083,6 +2084,13 @@ def _(x):
RECORDS_REST_DEFAULT_SORT[index] = dict(
query='bestmatch', noquery='mostrecent')

# ------ ACQUISITION ACCOUNTS SORT
RECORDS_REST_SORT_OPTIONS['acq_accounts']['name'] = dict(
fields=['name_sort'], title='Account name',
default_order='asc'
)
RECORDS_REST_DEFAULT_SORT['acq_accounts'] = dict(
query='bestmatch', noquery='name')

# ------ ACQUISITION ORDER LINES SORT
RECORDS_REST_SORT_OPTIONS['acq_order_lines'] = dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"type": "keyword"
},
"name": {
"type": "text"
"type": "text",
"copy_to": "name_sort"
},
"name_sort": {
"type": "keyword"
},
"description": {
"type": "text"
Expand Down

0 comments on commit d0f412c

Please sign in to comment.