(self, vals)
return invoice
Complete registration key for auto-generated invoices.
Complete registration key for auto-generated invoices.
Complete registration key for auto - generated invoices .
def create(self, vals):
        """Complete registration key for auto-generated invoices."""
        if "refund" in vals.get("move_type", "") and not vals.get("sii_refund_type"):
            vals["sii_refund_type"] = "I"
        invoice = super().create(vals)
        if (
            invoice.is_invoice()
            and vals.get("fiscal_position_id")
            and not vals.get("sii_registration_key")
        ):
            invoice.onchange_fiscal_position_id_l10n_es_aeat_sii()
        return invoice
def create ( self , vals ) : if "refund" in vals . get ( "move_type" , "" ) and not vals . get ( "sii_refund_type" ) : vals [ "sii_refund_type" ] = "I" invoice = super ( ) . create ( vals ) if ( invoice . is_invoice ( ) and vals . get ( "fiscal_position_id" ) and not vals . get ( "sii_registration_key" ) ) : invoice . onchange_fiscal_position_id_l10n_es_aeat_sii ( ) return invoice