def __init__(self, parent): CStockMotionBaseDialog.__init__(self, parent) self.btnAddRecipe = QtGui.QPushButton(u'По рецепту', self) self.btnAddRecipe.setObjectName('btnAddRecipe') self.addModels('InItems', CItemsModel(self, False)) self.addModels('OutItems', CItemsModel(self, True)) self.setupUi(self) self.buttonBox.addButton(self.btnAddRecipe, QtGui.QDialogButtonBox.ActionRole) self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowMaximizeButtonHint | QtCore.Qt.WindowCloseButtonHint) self.setupDirtyCather() self.tblInItems.setModel(self.modelInItems) self.prepareItemsPopupMenu(self.tblInItems) self.tblInItems.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.tblInItems.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.tblOutItems.setModel(self.modelOutItems) self.prepareItemsPopupMenu(self.tblOutItems) self.tblOutItems.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.tblOutItems.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows)
def __init__(self, parent): CStockMotionBaseDialog.__init__(self, parent) self.addModels('Items', CItemsModel(self)) self.setupUi(self) self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowMaximizeButtonHint | QtCore.Qt.WindowCloseButtonHint) self.setupDirtyCather() self.tblItems.setModel(self.modelItems) self.prepareItemsPopupMenu(self.tblItems) self.tblItems.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.tblItems.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
def __init__(self, parent): CStockMotionBaseDialog.__init__(self, parent) self.addModels('Items', CItemsModel(self)) self.actDuplicate = QtGui.QAction(u'Дублировать', self) self.actDuplicate.setObjectName('actDuplicate') self.btnFill = QtGui.QPushButton(u'Заполнить', self) self.btnFill.setObjectName('btnFill') self.btnFill.setShortcut('F9') self.setupUi(self) self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowMaximizeButtonHint | QtCore.Qt.WindowCloseButtonHint) self.setupDirtyCather() self.tblItems.setModel(self.modelItems) self.prepareItemsPopupMenu(self.tblItems) self.tblItems.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.tblItems.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.buttonBox.addButton(self.btnFill, QtGui.QDialogButtonBox.ActionRole)
def getRecord(self): record = CStockMotionBaseDialog.getRecord(self) getRBComboBoxValue(self.cmbSupplier, record, 'receiver_id') getRBComboBoxValue(self.cmbSupplierPerson, record, 'receiverPerson_id') record.setValue('type', 3) return record
def setRecord(self, record): CStockMotionBaseDialog.setRecord(self, record) self.modelInItems.loadItems(self.itemId()) self.modelOutItems.loadItems(self.itemId()) self.setIsDirty(False)
def setDefaults(self): CStockMotionBaseDialog.setDefaults(self)
def setRecord(self, record): CStockMotionBaseDialog.setRecord(self, record) setRBComboBoxValue(self.cmbReceiver, record, 'receiver_id') setRBComboBoxValue(self.cmbReceiverPerson, record, 'receiverPerson_id') self.modelItems.loadItems(self.itemId()) self.setIsDirty(False)
def getRecord(self): record = CStockMotionBaseDialog.getRecord(self) record.setValue('type', 4) return record