(self, tipo_comunicacion=False, cancellation=False)
return header
Builds SII send header

        :param tipo_comunicacion String 'A0': new reg, 'A1': modification
        :param cancellation Bool True when the communitacion es for invoice
            cancellation
        :return Dict with header data depending on cancellation
Builds SII send header
Builds SII send header
def _get_sii_header(self, tipo_comunicacion=False, cancellation=False):
        """Builds SII send header

        :param tipo_comunicacion String 'A0': new reg, 'A1': modification
        :param cancellation Bool True when the communitacion es for invoice
            cancellation
        :return Dict with header data depending on cancellation
        """
        self.ensure_one()
        company = self.company_id
        if not company.vat:
            raise exceptions.UserError(
                _("No VAT configured for the company '{}'").format(company.name)
            )
        header = {
            "IDVersionSii": SII_VERSION,
            "Titular": {
                "NombreRazon": self.company_id.name[0:120],
                "NIF": self.company_id.vat[2:],
            },
        }
        if not cancellation:
            header.update({"TipoComunicacion": tipo_comunicacion})
        return header
def _get_sii_header ( self , tipo_comunicacion = False , cancellation = False ) : self . ensure_one ( ) company = self . company_id if not company . vat : raise exceptions . UserError ( _ ( "No VAT configured for the company '{}'" ) . format ( company . name ) ) header = { "IDVersionSii" : SII_VERSION , "Titular" : { "NombreRazon" : self . company_id . name [ 0 : 120 ] , "NIF" : self . company_id . vat [ 2 : ] , } , } if not cancellation : header . update ( { "TipoComunicacion" : tipo_comunicacion } ) return header