Skip to content

Commit

Permalink
circulation: add more informations on loan dump
Browse files Browse the repository at this point in the history
Adds more informations when loans has dump for circulation UI.
Informations added are the item destination library code and item
destination location code.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai authored and Aboubakr Aly Badr committed Aug 19, 2020
1 parent 3cb8d71 commit c12a4df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rero_ils/modules/loans/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,12 @@ def dumps_for_circulation(self):
if LoanState.ITEM_IN_TRANSIT_FOR_PICKUP:
destination_loc_pid = self.get('pickup_location_pid')
destination_loc = Location.get_record_by_pid(destination_loc_pid)
destination_lib = destination_loc.get_library()
data['item_destination'] = {
'location_name': destination_loc.get('name'),
'library_name': destination_loc.get_library().get('name')
'location_code': destination_loc.get('code'),
'library_name': destination_lib.get('name'),
'library_code': destination_lib.get('code')
}

return data
Expand Down

0 comments on commit c12a4df

Please sign in to comment.