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 authored and blankoworld committed Jul 23, 2020
1 parent 068eaac commit be7eb8b
Show file tree
Hide file tree
Showing 20 changed files with 13,920 additions and 176 deletions.
22 changes: 15 additions & 7 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
from .modules.items.models import ItemCirculationAction
from .modules.items.permissions import can_create_item_factory, \
can_delete_item_factory, can_update_item_factory
can_update_delete_item_factory
from .modules.items.utils import item_location_retriever
from .modules.libraries.api import Library
from .modules.libraries.permissions import can_update_library_factory
from .modules.loans.api import Loan
Expand All @@ -65,6 +67,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 can_create_location_factory, \
Expand Down Expand Up @@ -1664,18 +1667,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 @@ -1754,7 +1759,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 be7eb8b

Please sign in to comment.