(self)
Process invoices for sending to the SII. Adds general checks from
        configuration parameters and invoice availability for SII. If the
        invoice is to be sent the decides the send method: direct send or
        via connector depending on 'Use connector' configuration
Process invoices for sending to the SII. Adds general checks from
        configuration parameters and invoice availability for SII. If the
        invoice is to be sent the decides the send method: direct send or
        via connector depending on 'Use connector' configuration
Process invoices for sending to the SII . Adds general checks from configuration parameters and invoice availability for SII . If the invoice is to be sent the decides the send method : direct send or via connector depending on Use connector configuration
def _process_invoice_for_sii_send(self):
        """Process invoices for sending to the SII. Adds general checks from
        configuration parameters and invoice availability for SII. If the
        invoice is to be sent the decides the send method: direct send or
        via connector depending on 'Use connector' configuration"""
        queue_obj = self.env["queue.job"].sudo()
        for invoice in self:
            company = invoice.company_id
            if not company.use_connector:
                invoice._send_invoice_to_sii()
            else:
                eta = company._get_sii_eta()
                new_delay = (
                    invoice.sudo()
                    .with_context(company_id=company.id)
                    .with_delay(eta=eta if not invoice.sii_send_failed else False)
                    .confirm_one_invoice()
                )
                job = queue_obj.search([("uuid", "=", new_delay.uuid)], limit=1)
                invoice.sudo().invoice_jobs_ids |= job
def _process_invoice_for_sii_send ( self ) : queue_obj = self . env [ "queue.job" ] . sudo ( ) for invoice in self : company = invoice . company_id if not company . use_connector : invoice . _send_invoice_to_sii ( ) else : eta = company . _get_sii_eta ( ) new_delay = ( invoice . sudo ( ) . with_context ( company_id = company . id ) . with_delay ( eta = eta if not invoice . sii_send_failed else False ) . confirm_one_invoice ( ) ) job = queue_obj . search ( [ ( "uuid" , "=" , new_delay . uuid ) ] , limit = 1 ) invoice . sudo ( ) . invoice_jobs_ids |= job