Skip to content

Commit

Permalink
item: add library name on the circulation dump
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Dec 6, 2023
1 parent 129afbc commit c7e975b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rero_ils/modules/items/dumpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def dump(self, record, data):
data['location']['organisation'] = {
'pid': record.organisation_pid
}

# add library and location name on same field (used for sorting)
library = location.get_library()
data['library_location_name'] = \
f'{library["name"]}: {data["location"]["name"]}'

data['actions'] = list(record.actions)

# only the first request is used by the UI
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/items/test_items_dumpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def test_item_action_circulation_dumper(

# organisation pid
assert data['location']['organisation']['pid']

# library and location name
assert data['library_location_name']

# actions
assert data['actions']

Expand Down

0 comments on commit c7e975b

Please sign in to comment.