Beispiel #1
0
 def _setup_events(self):
     SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     StockDecreaseWizardFinishEvent.connect(
         self._on_StockDecreaseWizardFinish)
     StockTransferWizardFinishEvent.connect(
         self._on_StockTransferWizardFinish)
Beispiel #2
0
    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()
Beispiel #4
0
    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()
Beispiel #5
0
    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()
Beispiel #6
0
    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()
Beispiel #7
0
    def __init__(self):
        SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        StockDecreaseWizardFinishEvent.connect(self._on_StockDecreaseWizardFinish)
        StockTransferWizardFinishEvent.connect(self._on_StockTransferWizardFinish)
        # TODO: Before enable the the NF-e generation. Save the invoice data,
        # in Invoice table (for each operation below).
#        NewLoanWizardFinishEvent.connect(self._on_NewLoanWizardFinish)

        pm = PermissionManager.get_permission_manager()
        pm.set('InvoiceLayout', pm.PERM_HIDDEN)
        pm.set('InvoicePrinter', pm.PERM_HIDDEN)

        # since the nfe plugin was enabled, the user must not be able to print
        # the regular fiscal invoice (replaced by the nfe).
        pm.set('app.sales.print_invoice', pm.PERM_HIDDEN)
        self._update_forms()
Beispiel #8
0
    def __init__(self):
        SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        StockDecreaseWizardFinishEvent.connect(
            self._on_StockDecreaseWizardFinish)
        StockTransferWizardFinishEvent.connect(
            self._on_StockTransferWizardFinish)
        # TODO: Before enable the the NF-e generation. Save the invoice data,
        # in Invoice table (for each operation below).
        #        NewLoanWizardFinishEvent.connect(self._on_NewLoanWizardFinish)

        pm = PermissionManager.get_permission_manager()
        pm.set('InvoiceLayout', pm.PERM_HIDDEN)
        pm.set('InvoicePrinter', pm.PERM_HIDDEN)

        # since the nfe plugin was enabled, the user must not be able to print
        # the regular fiscal invoice (replaced by the nfe).
        pm.set('app.sales.print_invoice', pm.PERM_HIDDEN)
        self._update_forms()
Beispiel #9
0
    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()
Beispiel #10
0
    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()
Beispiel #12
0
 def finish(self):
     self.retval = self.model
     self.model.confirm()
     self.close()
     StockDecreaseWizardFinishEvent.emit(self.model)
     self._receipt_dialog()
Beispiel #13
0
 def _setup_events(self):
     SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     StockDecreaseWizardFinishEvent.connect(self._on_StockDecreaseWizardFinish)
     StockTransferWizardFinishEvent.connect(self._on_StockTransferWizardFinish)