Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acquisition: cleanup useless functions of order lines resource #867

Merged
merged 1 commit into from
Apr 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions rero_ils/modules/acq_order_lines/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,9 @@ def organisation_pid(self):
@property
def library_pid(self):
"""Shortcut for acquisition order library pid."""
from ..acq_orders.api import AcqOrder
order = AcqOrder.get_record_by_pid(self.order_pid)
return order.library_pid

def get_organisation(self):
"""Shortcut to the organisation of the acquisition order."""
return self.get_library().get_organisation()

def get_library(self):
"""Shortcut to the library of the acquisition order."""
return self.get_order().get_library()
return self.get_order().library_pid

def get_order(self):
"""Shortcut to the order of the order line."""
from ..acq_orders.api import AcqOrder
return AcqOrder.get_record_by_pid(self.order_pid)

def get_number_of_acq_order_lines(self):
"""Get number of aquisition order lines."""
results = AcqOrderLinesSearch().filter(
'term', acq_order__pid=self.order_pid).source().count()
return results