(self)
return super().unlink()
A registered invoice at the SII cannot be deleted
A registered invoice at the SII cannot be deleted
A registered invoice at the SII cannot be deleted
def unlink(self):
        """A registered invoice at the SII cannot be deleted"""
        for invoice in self.filtered(lambda x: x.is_invoice()):
            if invoice.sii_state != "not_sent":
                raise exceptions.UserError(
                    _("You cannot delete an invoice already registered at the " "SII.")
                )
        return super().unlink()
def unlink ( self ) : for invoice in self . filtered ( lambda x : x . is_invoice ( ) ) : if invoice . sii_state != "not_sent" : raise exceptions . UserError ( _ ( "You cannot delete an invoice already registered at the " "SII." ) ) return super ( ) . unlink ( )