Skip to content

Commit

Permalink
circulation: adapt reroils
Browse files Browse the repository at this point in the history
Adapts reroils after the upgrade to invenio-circulation v1.0.0a21.

The two transitions ItemOnLoanToItemReturned and ItemOnLoanToItemReturned are
temporarily updated and inserted into reroils until a fix for the issue
inveniosoftware/invenio-circulation#127 is available.

This PR expects the fix for the ITEM_AT_DESK problem in the current version
of invenio-circulation.

Some timezone units testing are disabled until a fix is given in a later PR.

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
  • Loading branch information
Aly Badr committed Aug 4, 2020
1 parent 86a4f10 commit d22cc03
Show file tree
Hide file tree
Showing 20 changed files with 13,919 additions and 176 deletions.
21 changes: 14 additions & 7 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from .modules.items.api import Item
from .modules.items.models import ItemCirculationAction
from .modules.items.permissions import ItemPermission
from .modules.items.utils import item_location_retriever
from .modules.libraries.api import Library
from .modules.libraries.permissions import LibraryPermission
from .modules.loans.api import Loan
Expand All @@ -69,6 +70,7 @@
ItemOnLoanToItemReturned
from .modules.loans.utils import can_be_requested, get_default_loan_duration, \
get_extension_params, is_item_available_for_checkout, \
loan_build_document_ref, loan_build_item_ref, loan_build_patron_ref, \
loan_satisfy_circ_policies
from .modules.locations.api import Location
from .modules.locations.permissions import LocationPermission
Expand Down Expand Up @@ -1819,18 +1821,20 @@ def _(x):
OAISERVER_ID_PREFIX = 'oai:ils.rero.ch:'

#: Invenio circulation configuration.
CIRCULATION_ITEM_EXISTS = Item.get_record_by_pid
CIRCULATION_ITEM_EXISTS = Item.item_exists
CIRCULATION_PATRON_EXISTS = Patron.get_record_by_pid

CIRCULATION_ITEM_LOCATION_RETRIEVER = Item.item_location_retriever
CIRCULATION_ITEM_LOCATION_RETRIEVER = item_location_retriever
CIRCULATION_DOCUMENT_RETRIEVER_FROM_ITEM = \
Item.get_document_pid_by_item_pid
Item.get_document_pid_by_item_pid_object
CIRCULATION_ITEMS_RETRIEVER_FROM_DOCUMENT = Item.get_items_pid_by_document_pid

CIRCULATION_DOCUMENT_EXISTS = Document.get_record_by_pid
CIRCULATION_ITEM_REF_BUILDER = Loan.loan_build_item_ref
CIRCULATION_PATRON_REF_BUILDER = Loan.loan_build_patron_ref
CIRCULATION_DOCUMENT_REF_BUILDER = Loan.loan_build_document_ref

CIRCULATION_ITEM_REF_BUILDER = loan_build_item_ref
CIRCULATION_PATRON_REF_BUILDER = loan_build_patron_ref
CIRCULATION_DOCUMENT_REF_BUILDER = loan_build_document_ref

CIRCULATION_TRANSACTION_LOCATION_VALIDATOR = \
Location.transaction_location_validator
CIRCULATION_TRANSACTION_USER_VALIDATOR = \
Expand Down Expand Up @@ -1909,7 +1913,10 @@ def _(x):
dict(dest='CANCELLED', trigger='cancel', transition=ToCancelled)
],
'ITEM_IN_TRANSIT_FOR_PICKUP': [
dict(dest='ITEM_AT_DESK', trigger='receive'),
dict(
dest='ITEM_AT_DESK',
trigger='receive'
),
dict(dest='CANCELLED', trigger='cancel', transition=ToCancelled)
],
'ITEM_ON_LOAN': [
Expand Down
Loading

0 comments on commit d22cc03

Please sign in to comment.