Subversion Repositories SmartDukaan

Rev

Rev 11219 | Rev 11801 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11219 Rev 11751
Line 812... Line 812...
812
                if lineitem.quantity!=lineitem.unfulfilledQuantity:
812
                if lineitem.quantity!=lineitem.unfulfilledQuantity:
813
                    raise PurchaseServiceException(101, 'Items have already been received for this PO and hence cant change warehouse')
813
                    raise PurchaseServiceException(101, 'Items have already been received for this PO and hence cant change warehouse')
814
            purchaseOrder.warehouseId = warehouseId
814
            purchaseOrder.warehouseId = warehouseId
815
            session.commit()
815
            session.commit()
816
        finally:
816
        finally:
817
            self.close_session()    
817
            self.close_session()  
-
 
818
    
-
 
819
    def getPurchaseReturn(self, id):
-
 
820
        """
-
 
821
        Returns the purchase return with the given id. Throws an exception if there is no such purchase return.
-
 
822
        
-
 
823
        Parameters:
-
 
824
         - id
-
 
825
        """
-
 
826
        try:
-
 
827
            purchaseReturn = PurchaseReturn.get_by(id=id)
-
 
828
            if not purchaseReturn:
-
 
829
                raise PurchaseServiceException(101, "No purchase return can be found with id:" + str(id)) 
-
 
830
            return purchaseReturn.to_thrift_object()
-
 
831
        finally:
-
 
832
            self.close_session()
818
            
833
            
819
    def isAlive(self,):
834
    def isAlive(self,):
820
        """
835
        """
821
        For checking weather service is active alive or not. It also checks connectivity with database
836
        For checking weather service is active alive or not. It also checks connectivity with database
822
        """
837
        """