From: gfawcett Date: Sun, 5 Apr 2009 21:32:10 +0000 (+0000) Subject: clarify how the model knows if an item is 'in Reserves' or not X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d48b56da63fa24258865c84e3dacba745d692107;p=Syrup.git clarify how the model knows if an item is 'in Reserves' or not A live PhysicalObject record is the authoritative source. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@281 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/TODO b/conifer/TODO index d61f768..e00212e 100644 --- a/conifer/TODO +++ b/conifer/TODO @@ -5,6 +5,8 @@ IMPORTANT: * finish the physical-item received workflow. * how to model 'received' in the database? +* if someone has item checked out, show due date/time on item-about page. + * does 'move to new heading' show up in the right places? Should be like 'edit'. * a short-number for physical items. Sort of a barcode, but intended diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index b0f8574..a5ba061 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -481,12 +481,13 @@ class Item(m.Model): and a friendly description of the physical item's status""" if self.item_type != 'PHYS': return False, _('(Not a physical item)') - - #fixme: just having barcode in item-metadata doesn't mean 'in Reserves' + # An item is 'in Reserves' if we know its barcode, and if we + # have a live PhysicalObject record for it. bc = self.barcode() - if not bc: + if (not bc) or (not PhysicalObject.by_barcode(bc)): return False, _('On order') else: + # We need to check with the ILS to see if anyone has it out. status = lib_integration.item_status(bc) return status['available'], _(status['status'])