def actions(self): actions = [] #闭合的采购单不能再被修改 if "close" in self.request.GET: order_id = self.request.GET['close'] if is_closed(order_id): return actions if "_rel_document__id__exact" in self.request.GET: document_id = self.request.GET['_rel_document__id__exact'] item = getItem(document_id) if item is not None: document = Document.objects.get(id=document_id) if (item.status == ITEM_REJECTED) and isGroup( self, PROJECT_GROUP): actions.append(BatchChangeAction) if (item.status == ITEM_APPROVED) and isGroup( self, PURCHASE_GROUP) and ( document and not isPurchCompleted(document)): actions.append(PurchaseOrderSelectedAction) else: if isGroup(self, PROJECT_GROUP): actions.append(BatchChangeAction) return actions
def get_list_display_links(self): list_display_links = super(ReceivingLineAdmin, self).get_list_display_links() if "_q_" in self.request.GET: order_id = self.request.GET['_q_'] if is_closed(order_id): list_display_links = ('none') if is_closed_by_order_line_id(self): list_display_links = ('none') return list_display_links
def actions(self): #闭合的采购单不能再被修改 actions = [DeleteSelectedAction, BatchChangeAction] if "_q_" in self.request.GET: order_id = self.request.GET['_q_'] if is_closed(order_id): actions = None if is_closed_by_order_line_id(self): actions = None return actions
def actions(self): actions=[] #闭合的采购单不能再被修改 if "close" in self.request.GET: order_id = self.request.GET['close'] if is_closed(order_id): return actions if "_rel_document__id__exact" in self.request.GET: document_id = self.request.GET['_rel_document__id__exact'] item = getItem(document_id) if item is not None: document = Document.objects.get(id = document_id) if (item.status == ITEM_REJECTED) and isGroup(self, PROJECT_GROUP): actions.append(BatchChangeAction) if (item.status == ITEM_APPROVED) and isGroup(self, PURCHASE_GROUP) and (document and not isPurchCompleted(document)): actions.append(PurchaseOrderSelectedAction) else: if isGroup(self, PROJECT_GROUP): actions.append(BatchChangeAction) return actions