def finish(self): missing = get_missing_items(self.model, self.store) if missing: run_dialog(MissingItemsDialog, self, self.model, missing) return False # If this wizard is for a purchase return, the items are automatically # added so the tax check escaped. So we do it now. if self.receiving_order is not None: missing_tax_info = [] for item in self.model.get_items(): sellable = item.sellable try: sellable.check_taxes_validity() except TaxError: missing_tax_info.append(sellable.description) if missing_tax_info: warning(_("There are some items with missing tax information"), ', '.join(missing_tax_info)) return False invoice_ok = InvoiceSetupEvent.emit() if invoice_ok is False: # If there is any problem with the invoice, the event will display an error # message and the dialog is kept open so the user can fix whatever is wrong. return self.retval = self.model self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) # Commit before printing to avoid losing data if something breaks self.store.confirm(self.retval) self._receipt_dialog()
def finish(self): missing = get_missing_items(self.model, self.store) if missing: run_dialog(MissingItemsDialog, self, self.model, missing) return False self.retval = self.model self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) self._receipt_dialog()
def finish(self): missing = get_missing_items(self.model, self.store) if missing: run_dialog(MissingItemsDialog, self, self.model, missing) return False self.retval = self.model self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) # Commit before printing to avoid losing data if something breaks self.store.confirm(self.retval) self._receipt_dialog()
def finish(self): missing = get_missing_items(self.model, self.store) if missing: run_dialog(MissingItemsDialog, self, self.model, missing) return False invoice_ok = InvoiceSetupEvent.emit() if invoice_ok is False: # If there is any problem with the invoice, the event will display an error # message and the dialog is kept open so the user can fix whatever is wrong. return self.retval = self.model self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) # Commit before printing to avoid losing data if something breaks self.store.confirm(self.retval) self._receipt_dialog()
def finish(self): missing = get_missing_items(self.model, self.store) if missing: run_dialog(MissingItemsDialog, self, self.model, missing) return False # If this wizard is for a purchase return, the items are automatically # added so the tax check escaped. So we do it now. if self.receiving_order is not None: missing_tax_info = [] for item in self.model.get_items(): sellable = item.sellable try: sellable.check_taxes_validity() except TaxError: missing_tax_info.append(sellable.description) if missing_tax_info: warning(_("There are some items with missing tax information"), ', '.join(missing_tax_info)) return False invoice_ok = InvoiceSetupEvent.emit() if invoice_ok is False: # If there is any problem with the invoice, the event will display an error # message and the dialog is kept open so the user can fix whatever is wrong. return self.retval = self.model self.store.confirm(self.model) self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) # Commit before printing to avoid losing data if something breaks self.store.confirm(self.retval) self._receipt_dialog()
def finish(self): self.retval = self.model self.model.confirm() self.close() StockDecreaseWizardFinishEvent.emit(self.model) self._receipt_dialog()