Пример #1
0
    def finish(self):
        assert self.model
        assert self.model.branch

        # Remove the items that will not be received now.
        for item in self.model.get_items():
            if item.quantity > 0:
                continue
            self.store.remove(item)

        self.model.confirm()
        self.retval = self.model
        # Confirm before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        self._maybe_print_labels()
        ReceivingOrderWizardFinishEvent.emit(self.model)
        self.close()
Пример #2
0
    def finish(self):
        assert self.model
        assert self.model.branch

        # Remove the items that will not be received now.
        for item in self.model.get_items():
            if item.quantity > 0:
                continue
            self.store.remove(item)

        self.model.confirm()
        self.retval = self.model
        # Confirm before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        self._maybe_print_labels()
        ReceivingOrderWizardFinishEvent.emit(self.model)
        self.close()
Пример #3
0
    def finish(self):
        assert self.model
        assert self.model.branch

        # Remove the items that will not be received now.
        for item in self.model.get_items():
            if item.quantity > 0:
                continue
            ReceivingOrderItem.delete(item.id, store=self.store)

        if yesno(_(u'Do you want to print the labels for the received products?'),
                 gtk.RESPONSE_YES, _(u'Print labels'), _(u"Don't print")):
            label_data = run_dialog(SkipLabelsEditor, self, self.store)
            if label_data:
                print_labels(label_data, self.store, self.model.purchase)

        ReceivingOrderWizardFinishEvent.emit(self.model)

        self.retval = self.model
        self.model.confirm()
        self.close()
Пример #4
0
    def finish(self):
        assert self.model
        assert self.model.branch

        # Remove the items that will not be received now.
        for item in self.model.get_items():
            if item.quantity > 0:
                continue
            ReceivingOrderItem.delete(item.id, store=self.store)

        if yesno(
                _(u'Do you want to print the labels for the received products?'
                  ), gtk.RESPONSE_YES, _(u'Print labels'), _(u"Don't print")):
            label_data = run_dialog(SkipLabelsEditor, self, self.store)
            if label_data:
                print_labels(label_data, self.store, self.model.purchase)

        ReceivingOrderWizardFinishEvent.emit(self.model)

        self.retval = self.model
        self.model.confirm()
        self.close()