Skip to content

Commit

Permalink
acquisition: fix order lines useless methods
Browse files Browse the repository at this point in the history
Updates acquisition order lines resource to remove useless methods.

* Removes methods from order lines resource api.

Co-Authored-by: Lauren-D <[email protected]>
  • Loading branch information
lauren-d committed Mar 31, 2020
1 parent 0524143 commit f308c3c
Showing 1 changed file with 1 addition and 17 deletions.
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

0 comments on commit f308c3c

Please sign in to comment.