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 list_editable(self): 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 hasApprovedBySelf(self, item): return [] #采购部门可以修改实际采购名称 if (item.status == ITEM_APPROVED): if isGroup(self, PURCHASE_GROUP) and ( document and not isPurchCompleted(document)): return ['material'] else: return [] if (item.status == ITEM_REJECTED) and isGroup( self, PROJECT_GROUP): return [ 'expected_date', 'expected_quantity', 'brand', 'comments' ] if canEditAuditQty(self): return [ 'expected_date', 'audit_quantity', 'approval_comments' ] else: if isGroup(self, PROJECT_GROUP): return [ 'expected_date', 'expected_quantity', 'brand', 'comments' ]
def list_editable(self): 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 hasApprovedBySelf(self, item): return [] #采购部门可以修改实际采购名称 if (item.status == ITEM_APPROVED): if isGroup(self, PURCHASE_GROUP) and (document and not isPurchCompleted(document)): return ['material'] else: return [] if (item.status == ITEM_REJECTED) and isGroup(self, PROJECT_GROUP): return ['expected_date', 'expected_quantity', 'brand','comments'] if canEditAuditQty(self): return ['expected_date', 'audit_quantity', 'approval_comments'] else: if isGroup(self, PROJECT_GROUP): return ['expected_date', 'expected_quantity', 'brand', 'comments']
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