def flags(self, index): column = index.column() flags = CTreeModel.flags(self, index) item = index.internalPointer() if self._editable and (column == TreeColumns.EXTERNAL_ID or column == TreeColumns.TISSUE_TYPE and isinstance(item, CJobTicketTreeActionItem)): return flags | QtCore.Qt.ItemIsEditable else: return flags
def flags(self, index): flags = CTreeModel.flags(self, index) item = index.internalPointer() if not item.bookkeeperCode(): flags = flags & ~QtCore.Qt.ItemIsEnabled return flags