Minor fix

This commit is contained in:
Oscar Alvarez 2021-01-27 09:09:12 -05:00
parent 8c585617b5
commit 21b4fc5271
3 changed files with 10 additions and 5 deletions

View file

@ -29,7 +29,7 @@ def get_screen():
class QuickDialog(QDialog):
def __init__(self, parent, kind, string=None, data=None, widgets=None,
icon=None, size=None, readonly=False):
icon=None, size=None, readonly=False, buttons=True):
super(QuickDialog, self).__init__(parent)
# Size arg is in deprecation
if not size:
@ -109,11 +109,12 @@ class QuickDialog(QDialog):
_buttons.extend([self.cancel_button, self.ok_button])
self.buttonbox = QHBoxLayout()
for b in _buttons:
self.buttonbox.addWidget(b, 1)
if buttons:
for b in _buttons:
self.buttonbox.addWidget(b, 1)
self.buttonbox.setContentsMargins(0, 20, 0, 10)
main_vbox.addLayout(self.sub_hbox, 1)
main_vbox.setContentsMargins(20, 20, 20, 10)
main_vbox.addLayout(self.buttonbox, 1)
main_vbox.insertStretch(row_stretch, 0)

View file

@ -775,8 +775,11 @@ class DialogTaxes(QuickDialog):
class DialogChannel(QuickDialog):
def __init__(self, parent):
vbox_ = create_vbox(parent, parent.channels, parent.on_selected_channel)
super(DialogChannel, self).__init__(parent, 'action', widgets=[vbox_])
super(DialogChannel, self).__init__(parent, 'action', widgets=[vbox_],
buttons=False)
self.setWindowTitle('SELECCIONE EL CANAL')
width, height = get_screen()
self.setFixedSize(width * 0.6, height * 0.7)
class DialogPaymentTerm(QuickDialog):

View file

@ -1945,6 +1945,7 @@ class MainWindow(FrontWindow):
self.menu_dash.setDisabled(False)
else:
self.set_state('add')
self.action_channel()
def _set_sale_date(self):
if self._sale.get('sale_date'):