on li update, if the client cleared the marc (to reduce bandwidth), replace it
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 May 2008 15:44:42 +0000 (15:44 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 22 May 2008 15:44:42 +0000 (15:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9664 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm

index 8a3254f..38414f7 100644 (file)
@@ -570,13 +570,13 @@ sub update_lineitem {
     my $orig_li = $e->retrieve_acq_lineitem([
         $li->id,
         {   flesh => 1, # grab the lineitem with picklist attached
-            flesh_fields => {jub => ['picklist']}
+            flesh_fields => {jub => ['picklist', 'purchase_order']}
         }
     ]) or return $e->die_event;
 
-    # don't let anyone update someone else's lineitem
-    return OpenILS::Event->new('BAD_PARAMS') 
-        if $orig_li->picklist->owner != $e->requestor->id;
+    # the marc may have been cleared on retrieval...
+    $li->marc($e->retrieve_acq_lineitem($li->id)->marc)
+        unless $li->marc;
 
     $e->update_acq_lineitem($li) or return $e->die_event;
     $e->commit;