Subversion Repositories SmartDukaan

Rev

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

Rev 9696 Rev 9829
Line 786... Line 786...
786
                return False
786
                return False
787
            else:
787
            else:
788
                return True
788
                return True
789
        finally:
789
        finally:
790
            self.close_session()
790
            self.close_session()
-
 
791
            
-
 
792
    def changeWarehouseForPO(self, poId, warehouseId):
791
    
793
        try:
-
 
794
            purchaseOrder = PurchaseOrder.get_by(id = poId)
-
 
795
            for lineitem in purchaseOrder.lineitems:
-
 
796
                if lineitem.quantity!=lineitem.unfulfilledQuantity:
-
 
797
                    raise PurchaseServiceException(101, 'Items have already been received for this PO and hence cant change warehouse')
-
 
798
            purchaseOrder.warehouseId = warehouseId
-
 
799
            session.commit()
-
 
800
        finally:
-
 
801
            self.close_session()    
-
 
802
            
792
    def isAlive(self,):
803
    def isAlive(self,):
793
        """
804
        """
794
        For checking weather service is active alive or not. It also checks connectivity with database
805
        For checking weather service is active alive or not. It also checks connectivity with database
795
        """
806
        """
796
        try:
807
        try: